Part Number Hot Search : 
A7220 RB153 PF5102 NJW1139A HT6513 9307005 LSZ51C DDTC124
Product Description
Full Text Search
 

To Download LFXP2-8E-5FT256I Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  latticexp2? family handbook hb1004 version 02.5, february 2010
february 2010 ? 2010 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. www.latticesemi.com 1 section i. latticexp2 family data sheet introduction features ....................................................................................................................... ...................................... 1-1 introduction ................................................................................................................... ..................................... 1-2 architecture architecture overview .......................................................................................................... .............................. 2-1 pfu blocks ..................................................................................................................... ................................... 2-2 slice .......................................................................................................................... ................................ 2-3 modes of operation............................................................................................................. ...................... 2-5 routing........................................................................................................................ ....................................... 2-6 sysclock phase locked loops (pll) .............................................................................................. ............... 2-6 clock dividers ................................................................................................................. ................................... 2-7 clock distribution network ..................................................................................................... ............................ 2-8 primary clock sources.......................................................................................................... .................... 2-8 secondary clock/control sources ................................................................................................ .......... 2-10 edge clock sources............................................................................................................. ................... 2-11 primary clock routing .......................................................................................................... .................. 2-12 dynamic clock select (dcs) ..................................................................................................... ............. 2-12 secondary clock/control routing ................................................................................................ ........... 2-12 slice clock selection.......................................................................................................... ..................... 2-14 edge clock routing ............................................................................................................. ................... 2-15 sysmem memory .................................................................................................................. ........................... 2-16 sysmem memory block............................................................................................................ ............... 2-16 bus size matching .............................................................................................................. .................... 2-16 flashbak ebr content storage... ................ ................ ................ ................ ................. ............... .......... 2-16 memory cascading ............................................................................................................... .................. 2-17 single, dual and pseudo-dual port modes........................................................................................ ..... 2-17 memory core reset .............................................................................................................. .................. 2-17 ebr asynchronous reset......................................................................................................... .............. 2-18 sysdsp? block .................................................................................................................. ............................. 2-18 sysdsp block approach compare to general dsp ............................................................................... 2-18 sysdsp block capabilities ...................................................................................................... ................ 2-19 mult sysdsp element ............................................................................................................ .............. 2-20 mac sysdsp element ............................................................................................................. ............... 2-21 multaddsub sysdsp element ...................................................................................................... ..... 2-22 multaddsubsum sysdsp element ................................................................................................... 2-23 clock, clock enable and reset resources ........................................................................................ .... 2-23 signed and unsigned with different widths...................................................................................... ...... 2-24 overflow flag from mac ......................................................................................................... ......... 2-24 ipexpress?..................................................................................................................... ........................ 2-25 optimized dsp functions ........................................................................................................ ........................ 2-25 resources available in the latticexp2 family................................................................................... ..... 2-25 latticexp2 dsp performance..................................................................................................... ............ 2-25 programmable i/o cells (pic) ................................................................................................... ...................... 2-26 pio ............................................................................................................................ ....................................... 2-27 input register block ........................................................................................................... ..................... 2-27 output register block .......................................................................................................... ................... 2-28 tristate register block ........................................................................................................ .................... 2-30 latticexp2 family handbook table of contents
table of contents lattice semiconductor latt icexp2 family handbook 2 control logic block ............................................................................................................ ..................... 2-30 ddr memory support............................................................................................................. ......................... 2-30 dll calibrated dqs delay block ................................................................................................. .......... 2-32 polarity control logic ......................................................................................................... ..................... 2-33 dqsxfer........................................................................................................................ ....................... 2-34 sysio buffer ................................................................................................................... .................................. 2-34 sysio buffer banks ............................................................................................................. .................... 2-34 typical sysio i/o behavior during power-up..................................................................................... ..... 2-35 supported sysio standards ...................................................................................................... .............. 2-35 hot socketing.................................................................................................................. ........................ 2-37 ieee 1149.1-comp liant boundary scan te stability............ ................ ............. ............. ............. ............. ......... 2-37 flexiflash device configuration................................................................................................ ..................... 2-38 serial tag memory.............................................................................................................. ................... 2-39 live update technology ......................................................................................................... ................ 2-39 soft error detect (sed) support ................................................................................................ ............. 2-40 on-chip oscillator............................................................................................................. ...................... 2-40 density shifting ............................................................................................................... ................................. 2-41 dc and switching characteristics absolute maximum ratings ....................................................................................................... ........................ 3-1 recommended operating conditions ............................................................................................... ................. 3-1 on-chip flash memory specifications............................................................................................ ................... 3-1 hot socketing specifications................................................................................................... ........................... 3-2 dc electrical characteristics.................................................................................................. ............................ 3-2 supply current (standby)....................................................................................................... ............................ 3-3 initialization supply current .................................................................................................. ............................. 3-4 programming and erase flash supply current ..................................................................................... ............ 3-5 sysio recommended operating conditions......................................................................................... ............. 3-6 sysio single-ended dc electrical characteristics............................................................................... .............. 3-7 sysio differential electrical characteristics .................................................................................. ..................... 3-8 lvds........................................................................................................................... .............................. 3-8 differential hstl and sstl..................................................................................................... ................. 3-8 lvds25e ........................................................................................................................ .......................... 3-8 lvcmos33d ...................................................................................................................... ...................... 3-9 blvds .......................................................................................................................... .......................... 3-10 lvpecl ......................................................................................................................... ......................... 3-11 rsds ........................................................................................................................... ........................... 3-12 mlvds.......................................................................................................................... .......................... 3-13 typical building block function performance1................................................................................... ............. 3-14 pin-to-pin performance (lvcmos25 12ma drive) ................................................................................ 3-1 4 register-to-register performance ............................................................................................... ........... 3-14 derating timing tables ......................................................................................................... ........................... 3-15 latticexp2 external switching characteristics .................................................................................. .............. 3-16 latticexp2 internal switching characteristics1................................................................................. ............... 3-19 ebr timing diagrams............................................................................................................ .......................... 3-22 latticexp2 family timing adders ................................................................................................ .................... 3-24 sysclock pll timing ............................................................................................................ ........................ 3-27 latticexp2 sysconfig port timing specifications................................................................................ ......... 3-28 on-chip oscillator and configuration master clock char acteristics.............................................................. .. 3-29 flash download time (from on-chip flash to sram) ............................................................................... ..... 3-30 flash program time............................................................................................................. ............................ 3-30 flash erase time ............................................................................................................... .............................. 3-30 flashbak time (from ebr to flas h) ............... ................ ................ ................ ................ ............... ................. 3-31 jtag port timing specifications ................................................................................................ ..................... 3-31 switching test conditions...................................................................................................... .......................... 3-33
table of contents lattice semiconductor latt icexp2 family handbook 3 pinout information signal descriptions ............................................................................................................ ................................ 4-1 pics and ddr data (dq) pins associated with the ddr strobe (dqs) pin .................................................... 4-3 pin information summary........................................................................................................ ........................... 4-4 logic signal connections....................................................................................................... ............................ 4-5 thermal management ............................................................................................................. ........................... 4-5 for further information ........................................................................................................ .............................. 4-5 ordering information part number description........................................................................................................ ............................ 5-1 ordering information ........................................................................................................... ............................... 5-1 lead-free packaging............................................................................................................ .................... 5-2 conventional packaging ......................................................................................................... .................. 5-5 supplemental information for further information ........................................................................................................ .............................. 6-1 latticexp2 family data sheet revision history revision history ............................................................................................................... .................................. 7-1 section ii. latticexp2 family technical notes latticexp2 sysio usage guide introduction ................................................................................................................... ..................................... 8-1 sysio buffer overview .......................................................................................................... ............................. 8-1 supported sysio standards ...................................................................................................... ......................... 8-1 sysio banking scheme........................................................................................................... ........................... 8-3 spi flash interface............................................................................................................ ........................ 8-3 jtag interface ................................................................................................................. ......................... 8-3 v ccio (1.2v/1.5v/1.8v/2.5v/3.3v) .................................................................................................... ........ 8-4 v ccaux (3.3v) ........................................................................................................................ ................... 8-4 v ccj (1.2v/1.5v/1.8v/2.5v/3.3v).................................................................................................... .......... 8-4 input reference voltage (v ref1, v ref2 )................................................................................................... 8-4 v ref1 for ddr memory interface ...................................................................................................... ....... 8-4 mixed voltage support in a bank................................................................................................ .............. 8-4 sysio standards supported by bank .............................................................................................. .......... 8-5 lvcmos buffer configurations ................................................................................................... ...................... 8-6 bus maintenance circuit ........................................................................................................ ................... 8-6 programmable drive ............................................................................................................. .................... 8-6 programmable slew rate ......................................................................................................... ................ 8-6 open-drain control ............................................................................................................. ...................... 8-6 differential sstl and hstl support............................................................................................. ............ 8-6 pci support with programmable pciclamp ......................................................................................... .. 8-7 programmable input delay ....................................................................................................... ................ 8-7 software sysio attributes...................................................................................................... ............................. 8-7 io_type ........................................................................................................................ ........................... 8-7 opendrain...................................................................................................................... ....................... 8-8 drive .......................................................................................................................... ............................. 8-8 pullmode ....................................................................................................................... ....................... 8-9 pciclamp....................................................................................................................... ......................... 8-9 slewrate ....................................................................................................................... ....................... 8-9 fixeddelay..................................................................................................................... ..................... 8-10 inbuf .......................................................................................................................... ........................... 8-10 din/dout....................................................................................................................... ........................ 8-10 loc............................................................................................................................ ............................. 8-10 design considerations and usage................................................................................................ ................... 8-10 banking rules .................................................................................................................. ....................... 8-10 differential i/o rules ......................................................................................................... ...................... 8-10 differential i/o implementation................................................................................................ ......................... 8-11
table of contents lattice semiconductor latt icexp2 family handbook 4 lvds........................................................................................................................... ............................ 8-11 blvds .......................................................................................................................... .......................... 8-11 rsds ........................................................................................................................... ........................... 8-11 lvpecl ......................................................................................................................... ......................... 8-11 differential sstl and hstl..................................................................................................... ............... 8-11 mlvds.......................................................................................................................... .......................... 8-11 technical support assistance................................................................................................... ....................... 8-11 revision history ............................................................................................................... ................................ 8-11 appendix a. hdl attributes for synplicity ? and precision ? rtl synthesis...................................................... 8-12 vhdl synplicity/precision rtl synthesis ........................................................................................ ...... 8-12 verilog synplicity............................................................................................................. ........................ 8-14 verilog precision .............................................................................................................. ....................... 8-15 appendix b. sysio attributes using the design planner user interface .......................................................... 8 -16 appendix c. sysio attributes using preference file (ascii file) ................................................................ .... 8-17 iobuf .......................................................................................................................... ........................... 8-17 locate......................................................................................................................... ......................... 8-17 use din cell................................................................................................................... ..................... 8-18 use dout cell.................................................................................................................. .................. 8-18 group vref ..................................................................................................................... ................... 8-18 latticexp2 sysclock pll design and usage guide introduction ................................................................................................................... ..................................... 9-1 clock/control distribution network ............................................................................................. ....................... 9-1 latticexp2 top level view ...................................................................................................... .......................... 9-1 primary clocks ................................................................................................................. .................................. 9-2 secondary clocks ............................................................................................................... ............................... 9-2 edge clocks .................................................................................................................... ................................... 9-2 primary clock note ............................................................................................................. ............................... 9-3 specifying clocks in the design tools .......................................................................................... ..................... 9-3 primary-pure and primary-dcs................................................................................................... ............. 9-3 global primary clock and quadrant primary clock ................................................................................ ........... 9-3 global primary clock ........................................................................................................... ..................... 9-3 quadrant primary clock......................................................................................................... ................... 9-4 sysclock? pll .................................................................................................................. ............................ 9-4 functional description......................................................................................................... ............................... 9-5 pll divider and delay blocks................................................................................................... ................ 9-5 pll inputs and outputs ......................................................................................................... ............................ 9-5 clki input ..................................................................................................................... ............................ 9-5 rst input ...................................................................................................................... ............................ 9-5 rstk input..................................................................................................................... ........................... 9-6 clkfb input.................................................................................................................... .......................... 9-6 clkop output ................................................................................................................... ....................... 9-6 clkos output with phase and duty cycle select .................................................................................. .9-6 clkok output with lower frequency .............................................................................................. ........ 9-6 clkok2 output .................................................................................................................. ...................... 9-6 lock output.................................................................................................................... ......................... 9-6 dynamic phase and dynamic duty cycle adjustment.............................................................................. 9- 6 wrdel (write delay) ............................................................................................................ ................... 9-7 pll attributes................................................................................................................. .................................... 9-7 fin ............................................................................................................................ ................................ 9-7 clki_div, clkfb_div, clkop_div, clkok_div ................................................................................ 9-7 frequency_pin_clki, frequency_pin_clkop, frequency_pin_clkok ............................ 9-7 clkop frequency tolerance ...................................................................................................... ............. 9-7 latticexp2 pll primitive definition............................................................................................ ........................ 9-8 eplld design migration from latticeecp2 to latticexp2 ....................................................................... 9-8
table of contents lattice semiconductor latt icexp2 family handbook 5 dynamic phase/duty mode........................................................................................................ ............... 9-8 dynamic phase adjustment/duty cycle select..................................................................................... ............. 9-9 pll usage in ipexpress? ........................................................................................................ ....................... 9-10 configuration tab.............................................................................................................. ...................... 9-11 pll modes of operation ......................................................................................................... ......................... 9-13 pll clock injection removal .................................................................................................... .............. 9-13 pll clock phase adjustment..................................................................................................... ............. 9-14 ipexpress output ............................................................................................................... .............................. 9-14 use of the pre-map preference editor ........................................................................................... .................. 9-15 clock dividers (clkdiv)........................................................................................................ .......................... 9-15 clkdiv primitive definition .................................................................................................... ................ 9-15 clkdiv declaration in vhdl source code......................................................................................... ... 9-16 clkdiv usage with verilog - example ............................................................................................ ....... 9-17 clkdiv example circuits ........................................................................................................ ............... 9-17 reset behavior................................................................................................................. ....................... 9-18 release behavior............................................................................................................... ..................... 9-18 clkdiv inputs-to-outputs delay matching........................................................................................ ..... 9-19 dcs (dynamic clock select) ..................................................................................................... ...................... 9-19 dcs primitive definition....................................................................................................... ................... 9-19 dcs timing diagrams ............................................................................................................ ................ 9-20 dcs usage with vhdl - example .................................................................................................. ........ 9-21 dcs usage with verilog - example ............................................................................................... ......... 9-22 oscillator (osce).............................................................................................................. ...................... 9-22 osc primitive symbol (osce) .................................................................................................... ........... 9-22 osc usage with vhdl - example.................................................................................................. ........ 9-23 osc usage with verilog - example ............................................................................................... ......... 9-23 setting clock preferences...................................................................................................... ................. 9-23 power supplies ................................................................................................................. ............................... 9-23 technical support assistance................................................................................................... ....................... 9-23 revision history ............................................................................................................... ................................ 9-23 appendix a. primary clock sources and distribution ............................................................................. ......... 9-24 appendix b. pll, clkidv and eclk locations and connectivity .................................................................. 9- 25 appendix c. clock preferences .................................................................................................. ..................... 9-26 asic........................................................................................................................... ............................. 9-26 frequency...................................................................................................................... .................... 9-26 maxskew................ ................. ................ ................ ................ ............. ............. ............. ...................... 9-26 multicycle ..................................................................................................................... .................... 9-26 period ......................................................................................................................... ......................... 9-26 prohibit ....................................................................................................................... ........................ 9-26 use primary .................................................................................................................... ................... 9-26 use secondary .................................................................................................................. ............... 9-26 use edge....................................................................................................................... ....................... 9-27 clock_to_out ................................................................................................................... ................ 9-27 input_setup .................................................................................................................... ................... 9-27 pll_phase_back......... ................ ................ ................ ................. ................ ............. .......... ............... 9-27 latticexp2 memory usage guide introduction ................................................................................................................... ................................... 10-1 memories in latticexp2 devices ................................................................................................. .................... 10-1 utilizing ipexpress............................................................................................................ ................................ 10-2 ipexpress flow................................................................................................................. ....................... 10-3 memory modules................................................................................................................. ............................. 10-6 single port ram (ram_dq) ? ebr based ........................................................................................... .10-6 true dual port ram (ram_dp_true) ? ebr based ......................................................................... 10-11 pseudo dual port ram (ram_dp) ? ebr based ................................................................................ 10-17
table of contents lattice semiconductor latt icexp2 family handbook 6 read only memory (rom) - ebr based............................................................................................. .10-20 first in first out (fifo, fifo_dc) ? ebr based................................................................................. 10-23 distributed single port ram (distributed_spram) ? pfu based........................................................ 10-35 distributed dual port ram (distributed_dpram) ? pfu based .......................................................... 10-37 distributed rom (distributed_rom) ? pfu based .............................................................................. 10-3 9 user tag memory ................................................................................................................ ................ 10-41 basic specifications for tag memory............................................................................................ ................ 10-41 general description ............................................................................................................ .................. 10-43 pin descriptions ............................................................................................................... ..................... 10-43 spi operations................................................................................................................. ..................... 10-44 specifications and timing diagrams............................................................................................. ........ 10-49 initializing memory ............................................................................................................ ............................. 10-50 initialization file format ..................................................................................................... ................... 10-50 binary file .................................................................................................................... ......................... 10-51 hex file ....................................................................................................................... .......................... 10-51 addressed hex.................................................................................................................. .................... 10-51 flashbak? capability........................................................................................................... ......................... 10-52 technical support assistance................................................................................................... ..................... 10-52 revision history ............................................................................................................... .............................. 10-53 appendix a. attribute definitions.............................................................................................. ...................... 10-54 data_width..................................................................................................................... .................. 10-54 regmode........................................................................................................................ .................... 10-54 resetmode ........ ................ ................. ................ ................ ................ ................ ............. ................. 10-54 csdecode....................................................................................................................... ................... 10-54 writemode...................................................................................................................... .................. 10-54 gsr ............................................................................................................................ .......................... 10-54 latticexp2 high-speed i/o interface introduction ................................................................................................................... ................................... 11-1 ddr and ddr2 sdram interfaces overview......................................................................................... ........ 11-1 implementing ddr memory interfaces with latticexp2 devices .................................................................... 1 1-3 dqs grouping................................................................................................................... ...................... 11-3 ddr software primitives........................................................................................................ ................. 11-4 memory read implementation ..................................................................................................... .................. 11-14 dll compensated dqs delay elements ............................................................................................. 11-14 dqs transition detect or automatic clock polarity select ................................................................... 11-1 4 data valid module.............................................................................................................. ................... 11-15 ddr i/o register implementation................................................................................................ ......... 11-15 memory read implementation in software ......................................................................................... .. 11-15 read timing waveforms.......................................................................................................... ............. 11-16 memory write implementation .................................................................................................... .......... 11-19 generic high speed ddr implementation .......................................................................................... .......... 11-22 generic ddr software primitives ................................................................................................ ......... 11-23 design rules/guidelines........................................................................................................ ............... 11-34 ddr usage in ipexpress ......................................................................................................... ...................... 11-34 ddr generic.................................................................................................................... ..................... 11-35 configuration tab.............................................................................................................. .................... 11-36 ddr_mem ........................................................................................................................ .................... 11-36 configuration tab.............................................................................................................. .................... 11-37 fcram (?fast cycle random access memory?) interface ........................................................................... 1 1-39 board design guidelines ........................................................................................................ ....................... 11-39 references..................................................................................................................... ................................ 11-39 technical support assistance................................................................................................... ..................... 11-40 revision history ............................................................................................................... .............................. 11-40
table of contents lattice semiconductor latt icexp2 family handbook 7 power estimation and management for latticexp2 devices introduction ................................................................................................................... ................................... 12-1 power supply sequencing and hot socketing...................................................................................... ........... 12-1 recommended power-up sequence .................................................................................................. .... 12-1 power calculator hardware assumptions.......................................................................................... .............. 12-1 power calculation equations .................................................................................................... ....................... 12-1 power calculations ............................................................................................................. .................... 12-2 using the power calculator..................................................................................................... ......................... 12-3 starting the power calculator .................................................................................................. ............... 12-3 creating a power calculator project ............................................................................................ ........... 12-4 power calculator main window ................................................................................................... ........... 12-5 power calculator wizard........................................................................................................ ................. 12-7 creating a new project without the ncd file ........ ............................................................................ .. 12-10 creating a new project with the ncd file ....................................................................................... ..... 12-10 opening an existing project.................................................................................................... .............. 12-12 importing a simulation file (vcd).............................................................................................. ........... 12-12 importing a trace report file (twr)............................................................................................ ........ 12-13 activity factor and toggle rate ................................................................................................ ..................... 12-13 ambient and junction temperatures and airflow .................................................................................. ........ 12-14 managing power consumption ..................................................................................................... ................. 12-14 power calculator assumptions ................................................................................................... ................... 12-15 technical support assistance................................................................................................... ..................... 12-15 revision history ............................................................................................................... .............................. 12-15 latticexp2 sysdsp usage guide introduction ................................................................................................................... ................................... 13-1 sysdsp block hardware .......................................................................................................... ........................ 13-1 sysdsp block software .......................................................................................................... ......................... 13-2 overview ....................................................................................................................... .......................... 13-2 targeting sysdsp block using ipexpress ......................................................................................... ..... 13-2 targeting the sysdsp block by inference.............. .......................................................................... ................ 13-9 sysdsp blocks in the report file ............................................................................................... ................... 13-11 map report file................................................................................................................ .................... 13-11 post par report file ........................................................................................................... ................. 13-12 targeting the sysdsp block using simulink...................................................................................... ............ 13-13 simulink overview.............................................................................................................. ................... 13-13 targeting the sysdsp block by instan tiating primitives......................................................................... ........ 13-14 sysdsp block control signal and data signal descriptions....................................................................... ... 13-14 technical support assistance................................................................................................... ..................... 13-14 revision history ............................................................................................................... .............................. 13-15 appendix a. dsp block primitives ............................................................................................... .................. 13-16 mult18x18b..................................................................................................................... ................... 13-16 mult18x18addsubb............................................................................................................... .......... 13-16 mult18x18addsubsumb............................................................................................................ ..... 13-17 mult18x18macb.................................................................................................................. .............. 13-19 mult36x36b..................................................................................................................... ................... 13-20 mult9x9b....................................................................................................................... ..................... 13-21 mult9x9addsubb................................................................................................................. ............ 13-21 mult9x9addsubsumb.............................................................................................................. ....... 13-22 latticexp2 sysconfig usage guide introduction ................................................................................................................... ................................... 14-1 programming overview........................................................................................................... ......................... 14-1 configuration pins............................................................................................................. ............................... 14-2 sysconfig pins................................................................................................................. .................... 14-3 programming sequence ........................................................................................................... ....................... 14-7
table of contents lattice semiconductor latt icexp2 family handbook 8 sram........................................................................................................................... ........................... 14-7 flash background ............................................................................................................... .................... 14-7 ispjtag pins ................................................................................................................... ................................ 14-8 tdo............................................................................................................................ ............................. 14-8 tdi ............................................................................................................................ .............................. 14-8 tms............................................................................................................................ ............................. 14-8 tck ............................................................................................................................ ............................. 14-8 vccj........................................................................................................................... ............................ 14-8 configuration and jtag voltage levels .......................................................................................... ....... 14-8 configuration modes and options................................................................................................ .................... 14-9 configuration options .......................................................................................................... ................... 14-9 slave spi mode ................................................................................................................. ..................... 14-9 master spi mode ................................................................................................................ .................. 14-10 self download mode ............................................................................................................. ................ 14-10 ispjtag mode ................................................................................................................... ................... 14-10 wake up options ................................................................................................................ ........................... 14-10 wake up sequence ............................................................................................................... ............... 14-11 software selectable options.................................................................................................... ...................... 14-12 slave spi port................................................................................................................. ...................... 14-12 master spi port................................................................................................................ ..................... 14-12 configuration mode............................................................................................................. .................. 14-12 done open drain ................................................................................................................ ................ 14-13 done external.................................................................................................................. .................... 14-13 master clock selection ......................................................................................................... ................ 14-13 security ....................................................................................................................... .......................... 14-13 wake up sequence ............................................................................................................... ............... 14-13 wake on lock selection......................................................................................................... .............. 14-14 power save..................................................................................................................... ...................... 14-14 one time programmable fuse..................................................................................................... ................. 14-14 user goe....................................................................................................................... ................................ 14-14 tag memory ..................................................................................................................... .............................. 14-14 slave spi mode operation....................................................................................................... ............. 14-15 user flash..................................................................................................................... ................................. 14-15 technical support assistance................................................................................................... ..................... 14-16 revision history ............................................................................................................... .............................. 14-17 latticexp2 configuration encryption and security usage guide introduction ................................................................................................................... ................................... 15-1 encryption/decryption flow ..................................................................................................... ........................ 15-1 encrypting the jedec file...................................................................................................... ......................... 15-1 isplever flow .................................................................................................................. ..................... 15-2 ispvm flow..................................................................................................................... ......................... 15-2 programming the key into the device............................................................................................ ......... 15-4 security bit for the configuration and user flash (config_secure).......................................................... 15-6 advanced security settings ..................................................................................................... ........................ 15-6 one-time programmable (otp) or permanent lock .................................................................................. .... 15-6 flash protect .................................................................................................................. .................................. 15-7 changing flash protect......................................................................................................... .................. 15-7 encryption ..................................................................................................................... ................................... 15-8 usercode in encrypted files .................................................................................................... ........................ 15-8 decryption flow ................................................................................................................ ............................... 15-8 verifying a configuration...................................................................................................... ............................ 15-9 references..................................................................................................................... .................................. 15-9 technical support assistance................................................................................................... ....................... 15-9 revision history ............................................................................................................... ................................ 15-9
table of contents lattice semiconductor latt icexp2 family handbook 9 latticexp2 soft error detection (sed) usage guide introduction ................................................................................................................... ................................... 16-1 sed overview................................................................................................................... ............................... 16-1 basic sed and one-shot sed modes ............................................................................................... .............. 16-2 basic sed ...................................................................................................................... ......................... 16-2 one-shot sed ................................................................................................................... ..................... 16-2 hardware description........................................................................................................... ............................ 16-2 signal descriptions ............................................................................................................ .............................. 16-2 sedclkin ....................................................................................................................... ....................... 16-3 osc_div ........................................................................................................................ ........................ 16-3 sedenable...................................................................................................................... ..................... 16-3 sedclkout ...................................................................................................................... .................... 16-3 sedstart ....................................................................................................................... ...................... 16-3 sedfrcerrn ..................................................................................................................... .................. 16-3 sedinprog...................................................................................................................... ..................... 16-4 seddone ........................................................................................................................ ...................... 16-4 sederr ......................................................................................................................... ........................ 16-4 sed flow ....................................................................................................................... .................................. 16-4 sed run time ................................................................................................................... .............................. 16-5 sample code .................................................................................................................... ............................... 16-6 basic sed vhdl example ......................................................................................................... ............ 16-6 one shot sed in vhdl ........................................................................................................... ............... 16-7 basic sed verilog example...................................................................................................... .............. 16-8 one-shot sed in verilog ........................................................................................................ ................ 16-9 technical support assistance................................................................................................... ....................... 16-9 revision history ............................................................................................................... .............................. 16-10 latticexp2 dual boot usage guide introduction ................................................................................................................... ................................... 17-1 dual boot mode ................................................................................................................. .............................. 17-1 dual boot flash programming .................................................................................................... ..................... 17-2 procedure...................................................................................................................... .......................... 17-2 technical support assistance................................................................................................... ....................... 17-6 revision history ............................................................................................................... ................................ 17-6 latticexp2 hardware checklist introduction ................................................................................................................... ................................... 18-1 power supply ................................................................................................................... ................................ 18-1 power supply sequencing ........................................................................................................ .............. 18-1 power supply ramp .............................................................................................................. ................. 18-2 power estimation ............................................................................................................... ..................... 18-2 configuration.................................................................................................................. .................................. 18-2 jtag interface ................................................................................................................. ....................... 18-3 i/o interface and critical pins ................................................................................................ .......................... 18-3 i/o pin assignments around v ccpll.......................................................................................................................... ........ 18-3 ddr/ddr2 memory interface pin assignments..................................................................................... 1 8-4 true-lvds output pin assignments............................................................................................... ........ 18-4 hstl and sstl pin assignments .................................................................................................. ........ 18-4 pci clamp pin assignment....................................................................................................... .............. 18-4 test output enable (toe) ....................................................................................................... ............... 18-4 checklist...................................................................................................................... ..................................... 18-5 technical support assistance................................................................................................... ....................... 18-5 revision history ............................................................................................................... ................................ 18-5 section iii. latticexp2 fam ily handbook revision history revision history ............................................................................................................... ................................ 19-1
section i. latticexp2 family data sheet ds1009 version 01.6, august 2008
www.latticesemi.com 1-1 ds1009 introduction_01.2 february 2008 data sheet ds1009 ? 2008 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. features ? flexiflash? architecture ? instant-on ? infinitely reconfigurable ? single chip ? flashbak? technology ?serial tag memory ?design security ? live update technology ? transfr? technology ? secure updates with 128 bit aes encryption ? dual-boot with external spi ? sysdsp? block ? three to eight blocks for high performance ? multiply and accumulate ? 12 to 32 18x18 multipliers ? each block supports one 36x36 multiplier or four 18x18 or eight 9x9 multipliers ? embedded and distributed memory ? up to 885 kbits sysmem? ebr ? up to 83 kbits distributed ram ? sysclock? plls ? up to four analog plls per device ? clock multiply, divide and phase shifting ? flexible i/o buffer ? sysio? buffer supports: ? lvcmos 33/25/18/15/12; lvttl ? sstl 33/25/18 class i, ii ? hstl15 class i; hstl18 class i, ii ?pci ? lvds, bus-lvds, mlvds, lvpecl, rsds ? pre-engineered source synchronous interfaces ? ddr / ddr2 interfaces up to 200 mhz ? 7:1 lvds interfaces support display applications ?xgmii ? density and package options ? 5k to 40k lut4s, 86 to 540 i/os ? csbga, tqfp, pqfp, ftbga and fpbga packages ? density migration supported ? flexible device configuration ? spi (master and slave) boot flash interface ? dual boot image supported ? soft error detect (sed) macro embedded ? system level support ? ieee 1149.1 and ieee 1532 compliant ? on-chip oscillator for in itialization & general use ? devices operate with 1.2v power supply table 1-1. latticexp2 family selection guide device xp2-5 xp2-8 xp2-17 xp2-30 xp2-40 luts (k) 5 8 172940 distributed ram (kbits) 1018355683 ebr sram (kbits) 166 221 276 387 885 ebr sram blocks 9 12 15 21 48 sysdsp blocks 3 4 5 7 8 18 x 18 multipliers 1216202832 v cc voltage 1.2 1.2 1.2 1.2 1.2 gpll 22444 max available i/o 172 201 358 472 540 packages and i/o combinations 132-ball csbga (8 x 8 mm) 86 86 144-pin tqfp (20 x 20 mm) 100 100 208-pin pqfp (28 x 28 mm) 146 146 146 256-ball ftbga (17 x17 mm) 172 201 201 201 484-ball fpbga (23 x 23 mm) 358 363 363 672-ball fpbga (27 x 27 mm) 472 540 latticexp2 family data sheet introduction
1-2 introduction lattice semiconductor lattice xp2 family data sheet introduction latticexp2 devices combine a look-up table (lut) based fpga fabric with non-volatile flash cells in an architec- ture referred to as flexiflash. the flexiflash approach provides bene fits including instant-on , infinite reconfigurabilit y, on chip storage with flashbak embedded block memory and serial tag memory and design security. the parts also support live update technology wit h transfr, 128-bit aes encryption and dual-boot technologies. the latticexp2 fpga fabric was optimized for the new technology from the outset with high performance and low cost in mind. latticexp2 devices include lut-based logic, distributed and embedded memory, phase locked loops (plls), pre-engineered source synchronous i/o support and enhanced sysdsp blocks. the isplever ? design tool from lattice allows large and complex designs to be efficiently implemented using the latticexp2 family of fpga devices. synthesis library suppo rt for latticexp2 is availabl e for popular logic synthesis tools. the isplever tool uses the synthesis tool output along with the constraints from its floor planning tools to place and route the design in the lattic exp2 device. the isplever tool extrac ts the timing from the routing and back-annotates it into the design for timing verification. lattice provides many pre-designed intellectual property (ip) isplevercore? modules for the latticexp2 family. by using these ips as standardized blocks, designers are free to concentrate on the unique aspects of their design, increasing their productivity.
www.latticesemi.com 2-1 ds1009 architecture_01.4 august 2008 data sheet ds1009 ? 2008 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. architecture overview each latticexp2 device contains an array of logic blocks surrounded by programmable i/o cells (pic). inter- spersed between the rows of logic blocks are rows of sysmem? embedded block ram (ebr) and a row of sys- dsp? digital signal processing blocks as shown in figure 2-1. on the left and right sides of the programmable functional unit (pfu) array, there are non-volatile memory blocks. in configuration mode the nonvolatile memory is programmed via the ieee 1149.1 tap port or the sysconfig? peripheral port. on power up, the configuration data is transferred from the non-volatile memory blocks to the con- figuration sram. with this technology, expensive external configuration memory is not required, and designs are secured from unauthorized read-back. this transfer of data from non-volatile memory to configuration sram via wide busses happens in microseconds, pr oviding an ?instant-on? capability that allows easy interfacing in many applications. latticexp2 devices can also transfer data from the sysmem ebr blocks to the non-volatile memory blocks at user request. there are two kinds of logic blocks, the pfu and the pfu without ram (pff). the pfu contains the building blocks for logic, arithmetic, ram and rom functions. the pff block contains building blocks for logic, arithmetic and rom functions. both pfu and pff blocks are optimized for flexibility allo wing complex designs to be imple- mented quickly and efficiently. logic blocks are arranged in a two-dimensional array. only one type of block is used per row. latticexp2 devices contain one or more rows of sysmem ebr blocks. sysmem ebrs are large dedicated 18kbit memory blocks. each sysmem block can be configured in a variety of depths and widths of ram or rom. in addi- tion, latticexp2 devices contain up to two rows of dsp blocks. each dsp block has multipliers and adder/accumu- lators, which are the buildin g blocks for complex signal processing capabilities. each pic block encompasses two pios (pio pairs) with their respective sysi o buffers. the sysio buffers of the latticexp2 devices are arranged into eight banks, allowing the implementation of a wide variety of i/o standards. pio pairs on the left and right edges of the device can be configured as lvds transmit/receive pairs. the pic logic also includes pre-engineered support to aid in the implementation of high speed source synchronous standards such as 7:1 lvds interfaces, found in many display app lications, and memory interfaces including ddr and ddr2. other blocks provided include plls and configuration functi ons. the latticexp2 architecture provides up to four general purpose plls (gpll) per device. the gpll blocks are located in the corners of the device. the configuration block that supports features such as configuration bit-stream de-encryption, transparent updates and dual boot support is located between banks two and three. every device in the latticexp2 family supports a sysconfig port, muxed with bank seven i/os, which supports serial device configuration. a jtag port is provided between banks two and three. this family also provides an on-chip oscillator and soft error detect (sed) ca pability. latticexp2 devices use 1.2v as their core voltage. latticexp2 family data sheet architecture
2-2 architecture lattice semiconductor lattice xp2 family data sheet figure 2-1. simplified block diagra m, latticexp2-17 device (top level) pfu blocks the core of the latticexp2 device is made up of logic blocks in two forms, pfus and pffs. pfus can be pro- grammed to perform logic, arithmetic, distributed ram and distributed rom functions. pff blocks can be pro- grammed to perform logic, arithmetic and rom functions. except where necessary, the remainder of this data sheet will use the term pfu to refer to both pfu and pff blocks. each pfu block consists of four interconnected slices, numbered slice 0 through slice 3, as shown in figure 2-2. all the interconnections to and from pfu blocks are from routing. there are 50 inputs and 23 outputs associated with each pfu block. on-chip oscillator programmable function units (pfus) spi port sysclock plls flexible routing flash jtag port sysio buffers, pre-engineered source synchronous support sysmem block ram dsp blocks
2-3 architecture lattice semiconductor lattice xp2 family data sheet figure 2-2. pfu diagram slice slice 0 through slice 2 contain two 4-input combinatorial look-up tables (lut4), which feed two registers. slice 3 contains two lut4s and no registers. for pfus, slice 0 and slice 2 can also be configured as distributed memory, a capability not available in pff blocks . table 2-1 shows the capability of th e slices in both pff and pfu blocks along with the operation modes they enable. in addition, each pfu contains logic that allows the luts to be com- bined to perform functions such as lut5, lut6, lut7 and lut8. there is control logic to perform set/reset func- tions (programmable as synchronous/asynchronous), clock select, chip-select and wider ram/rom functions. figure 2-3 shows an overview of the internal logic of the slice. the registers in the slice can be configured as posi- tive/negative edge triggered or level sensitive clocks. table 2-1. resources and modes available per slice slice 0 through slice 2 have 14 input signals: 13 signals from routing and one from the carry-chain (from the adja- cent slice or pfu). there are seven outputs: six to routing and one to carry-chain (to the adjacent pfu). slice 3 has 13 input signals from routing and four signals to routing. table 2-2 lists the signals associated with slice 0 to slice 2. slice pfu block pff block resources modes resources modes slice 0 2 lut4s and 2 registers logic, ripple, ram, rom 2 lut4s and 2 registers logic, ripple, rom slice 1 2 lut4s and 2 registers logic, ripple, rom 2 lut4s and 2 registers logic, ripple, rom slice 2 2 lut4s and 2 registers logic, ripple, ram, rom 2 lut4s and 2 registers logic, ripple, rom slice 3 2 lut4s logic, rom 2 lut4s logic, rom slice 0 lut4 & carry lut4 & carry d d slice 1 lut4 & carry lut4 & carry slice 2 lut4 & carry lut4 & carry from routing to routing slice 3 lut4 lut4 d d d d ff ff ff ff ff ff
2-4 architecture lattice semiconductor lattice xp2 family data sheet figure 2-3. slice diagram table 2-2. slice signal descriptions function type signal names description input data signal a0, b0, c0, d0 inputs to lut4 input data signal a1, b1, c1, d1 inputs to lut4 input multi-purpose m0 multipurpose input input multi-purpose m1 multipurpose input input control signal ce clock enable input control signal lsr local set/reset input control signal clk system clock input inter-pfu signal fci fast carry-in 1 input inter-slice signal fxa intermediate signal to generate lut6 and lut7 input inter-slice signal fxb intermediate signal to generate lut6 and lut7 output data signals f0, f1 lut4 output register bypass signals output data signals q0, q1 register outputs output data signals ofx0 output of a lut5 mux output data signals ofx1 output of a lut6, lut7, lut8 2 mux depending on the slice output inter-pfu signal fco slice 2 of each pfu is the fast carry chain output 1 1. see figure 2-3 for connection details. 2. requires two pfus. lut4 & carry* lut4 & carry* slice a0 c0 d0 ff* ofx0 f0 q0 a1 b1 c1 d1 ci ci co co ce clk lsr ff* ofx1 f1 q1 f/sum f/sum d d m1 fci into slice/pfu, fco from different slice/pfu fco from slice/pfu, fci into different slice/pfu lut5 mux m0 from routing to routing fxb fxa b0 for slices 0 and 2, memory control signals are generated from slice 1 as follows: wck is clk wre is from lsr di[3:2] for slice 2 and di[1:0] for slice 0 data wad [a:d] is a 4bit address from slice 1 lut input * not in slice 3
2-5 architecture lattice semiconductor lattice xp2 family data sheet modes of operation each slice has up to four potential modes of operation: logic, ripple, ram and rom. logic mode in this mode, the luts in each slice are configured as lut4s. a lut4 has 16 possible input combinations. four- input logic functions are generated by programming the lut4. since there are two lut4s per slice, a lut5 can be constructed within one slice. larger luts such as lu t6, lut7 and lut8, can be constructed by concatenating two or more slices. note that a lut8 requires more than four slices. ripple mode ripple mode allows efficient implementation of small arithmetic functions. in ripple mode, the following functions can be implemented by each slice: ? addition 2-bit ? subtraction 2-bit ? add/subtract 2-bit using dynamic control ? up counter 2-bit ? down counter 2-bit ? up/down counter with async clear ? up/down counter with preload (sync) ? ripple mode multiplier building block ? multiplier support ? comparator functions of a and b inputs ? a greater-than-or-equal-to b ? a not-equal-to b ? a less-than-or-equal-to b two carry signals, fci and fco, are generated per slice in this mode, allowing fast arit hmetic functions to be con- structed by concatenating slices. ram mode in this mode, a 16x4-bit distributed single port ram (spr) can be constructed using each lut block in slice 0 and slice 2 as a 16x1-bit memory. slice 1 is used to provide memory address and control signals. a 16x2-bit pseudo dual port ram (pdpr) memory is created by using one slice as the read-write port and the other companion slice as the read-only port. the lattice design tools support the creation of a variety of different size memories. where appropriate, the soft- ware will construct these using distribute d memory primitives that represent th e capabilities of the pfu. table 2-3 shows the number of slices required to implement different distributed ram primitives. for more information on using ram in latticexp2 devices, please see tn1137, latticexp2 memory usage guide . table 2-3. number of slices required for implementing distributed ram rom mode rom mode uses the lut logic; hence, slices 0 through 3 can be used in the rom mode. preloading is accom- plished through the programming interface during pfu configuration. spr 16x4 pdpr 16x4 number of slices 3 3 note: spr = single port ram, pdpr = pseudo dual port ram
2-6 architecture lattice semiconductor lattice xp2 family data sheet routing there are many resources provided in the latticexp2 devices to route signals individually or as busses with related control signals. the routing resources consist of switching circuitry, buffers and metal interconnect (routing) seg- ments. the inter-pfu connections are made with x1 (spans two pfu), x2 (spans three pfu) or x6 (spans seven pfu) connections. the x1 and x2 connections provide fast and ef ficient connections in horizontal and vertical directions. the x2 and x6 resources are buffered to allow both short and long connections routing between pfus. the latticexp2 family has an enhanced routing architec ture to produce a compact design. the isplever design tool takes the output of the synthesis tool and places an d routes the design. generally, the place and route tool is completely automatic, although an interactive routing editor is available to optimize the design. sysclock phase locked loops (pll) the sysclock plls provide the ability to synthesize clock frequencies. the latticexp2 family supports between two and four full featured general purpose plls (gpll). the architecture of the gpll is shown in figure 2-4. clki, the pll reference frequency, is provided either from the pin or from routing; it feeds into the input clock divider block. clkfb, the feedback signal, is generated from clkop (the primary clock output) or from a user clock pin/logic. clkfb feeds into the feedback divider and is used to multiply the reference frequency. both the input path and feedback sign als enter the voltage controlled oscilla tor (vco) block. the phase and fre- quency of the vco are determined from the input path and feedback signals. a lock signal is generated by the vco to indicate that the vco is locked with the input clock signal. the output of the vco feeds into the clkop divider, a po st-scalar divider. the duty cycle of the clkop divider output can be fine tuned using the duty trim block, which creates the clkop signal. by allowing the vco to oper- ate at higher frequencies than clkop, the frequency range of the gpll is expanded. the output of the clkop divider is passed through the clkok divider, a secondary clock divider, to generate lower frequencies for the clkok output. for applications that require even lower frequencies, the clkop signal is passed through a divide- by-three divider to produce the clkok2 output. the clko k2 output is provided for applications that use source synchronous logic. the phase/duty cycle/duty trim block is used to adjust the phase and duty cycle of the clkop divider output to generate the clkos signal. the phase/ duty cycle setting can be pre-programmed or dynamically adjusted. the clock outputs from the gpll; clkop, clkok, clkok2 and clkos, are fed to the clock distribution network. for further information on the gpll please see tn1126, latticexp2 sysclock pll design and usage guide .
2-7 architecture lattice semiconductor lattice xp2 family data sheet figure 2-4. general purpose pll (gpll) diagram table 2-4 provides a description of the signals in the gpll blocks. table 2-4. gpll block signal descriptions clock dividers latticexp2 devices have two clock dividers, one on the left side and one on the right side of the device. these are intended to generate a slower-speed system clock from a high-speed edge clock. the block operates in a 2, 4 or 8 mode and maintains a known phase relationship between the divided down clock and the high-speed clock based on the release of its reset signal. the clock divide rs can be fed from the clkop output from the gplls or from the edge clocks (eclk). the clock divider outputs serv e as primary clock sources and feed into the clock dis- tribution network. the reset (rst) control signal resets the input and forces all outputs to low. the release sig- nal releases outputs to the input clock. for furthe r information on clock dividers, please see tn1126, latticexp2 sysclock pll design and usage guide . figure 2-5 shows the clock divider connections. signal i/o description clki i clock input from external pin or routing clkfb i pll feedback input from clkop (pll internal), from clock net (clkop) or from a user clock (pin or logic) rst i ?1? to reset pll counters, vco, charge pumps and m-dividers rstk i ?1? to reset k-divider dphase [3:0] i dpa phase adjust input ddduty [3:0] i dpa duty cycle select input wrdel i dpa fine delay adjust input clkos o pll output clock to clock tree (phase shifted/duty cycle changed) clkop o pll output clock to clock tree (no phase shift) clkok o pll output to clock tree through secondary clock divider clkok2 o pll output to clock tree (clkop divided by 3) lock o ?1? indicates pll lock to clki clkfb divider rst clkfb clki lock clkop clkos rstk dphase internal feedback dduty wrdel clkok2 clkok clki divider pfd vco/ loop filter clkop divider phase/ duty cycle/ duty trim duty trim clkok divider lock detect 3
2-8 architecture lattice semiconductor lattice xp2 family data sheet figure 2-5. clock divider connections clock distribution network latticexp2 devices have eight quadrant-based primary cloc ks and between six and eight flexible region-based sec- ondary clocks/control signals. two high performance edge clocks are available on each edge of the device to sup- port high speed interfaces. the clock inputs are selected from external i/os, the sysclock plls, or routing. clock inputs are fed throughout the chip via the primary, secondary and edge clock networks. primary clock sources latticexp2 devices derive primary clocks from four sources: pll outputs, clkdiv outputs, dedicated clock inputs and routing. latticexp2 devices have two to four sysclock plls, located in the four corners of the device. there are eight dedicated clock inputs, two on each side of the device. figure 2-6 shows the primary clock sources. rst release 1 2 4 8 clkop (gpll) eclk clkdiv
2-9 architecture lattice semiconductor lattice xp2 family data sheet figure 2-6. primary clock sources for xp2-17 primary clock sources to eight quadrant clock selection from routing from routing gpll gpll pll input pll input note: this diagram shows sources for the xp2-17 device. smaller latticexp2 devices have two gplls. clk div clock input clock input pll input pll input clock input clock input clock input clock input clock input clock input gpll gpll clk div
2-10 architecture lattice semiconductor lattice xp2 family data sheet secondary clock/control sources latticexp2 devices derive secondary clocks (sc0 through sc7) from eight dedicated clock input pads and the rest from routing. figure 2-7 shows the secondary clock sources. figure 2-7. secondary clock sources secondary clock sources from routing from routing from routing from routing from routing from routing from routing from routing from routing from routing clock input clock input clock input clock input clock input clock input from routing from routing from routing from routing clock input clock input from routing from routing
2-11 architecture lattice semiconductor lattice xp2 family data sheet edge clock sources edge clock resources can be driven from a variety of sources at the same edge. edge clock resources can be driven from adjacent edge clock pios, primary clock pios, plls and clock dividers as shown in figure 2-8. figure 2-8. edge clock sources eight edge clocks (eclk) two clocks per edge sources for bottom edge clocks sources for right edge clocks clock input clock input from routing from routing from routing from routing from routing clock input clock input clock input clock input from routing from routing clock input clock input from routing sources for left edge clocks sources for top edge clocks pll input pll input gpll clkop clkos pll input gpll clkop clkos clkop clkos gpll pll input clkop clkos gpll note: this diagram shows sources for the xp2-17 device. smaller latticexp2 devices have two gplls.
2-12 architecture lattice semiconductor lattice xp2 family data sheet primary clock routing the clock routing structure in latticexp2 devices consists of a network of eight primary clock lines (clk0 through clk7) per quadrant. the primary clocks of each quadrant are generated from muxes located in the center of the device. all the clock sources are connected to these muxes. figure 2-9 shows the clock routing for one quadrant. each quadrant mux is identical. if desired, any clock can be routed globally. figure 2-9. per quadrant primary clock selection dynamic clock select (dcs) the dcs is a smart multiplexer function available in the primary clock routing. it switches between two independent input clock sources without any glitches or runt pulses. this is achieved irrespective of when the select signal is toggled. there are two dcs blocks per quadrant; in total, eight dcs blocks per device. the inputs to the dcs block come from the center muxes. the output of the dcs is connected to primary clocks clk6 and clk7 (see figure 2- 9). figure 2-10 shows the timing waveforms of the default dcs operating mode. the dcs block can be programmed to other modes. for more information on the dcs, please see tn1126, latticexp2 sysclock pll design and usage guide . figure 2-10. dcs waveforms secondary clock/control routing secondary clocks in the latticexp2 devices are region-bas ed resources. the benefit of region-based resources is the relatively low injection delay and skew within the region, as compared to primary clocks. ebr rows, dsp rows and a special vertical routing channel bound the secondary clock regions. this special vertical routing channel aligns with either the left edge of the center dsp block in the dsp row or the center of the dsp row. figure 2-11 shows this special vertical routing channel and the eight secondary clock regions for the latticexp2-40. clk0 clk1 clk2 clk3 clk4 clk5 clk6 clk7 30:1 30:1 30:1 30:1 29:1 29:1 29:1 29:1 30:1 30:1 8 primary clocks (clk0 to clk7) per quadrant dcs dcs primary clock sources: plls + clkdivs + pios + routing clk0 sel dcsout clk1
2-13 architecture lattice semiconductor lattice xp2 family data sheet latticexp2-30 and smaller devices have six secondary clock regions. all devices in the latticexp2 family have four secondary clocks (sc0 to sc3) which are distributed to every region. the secondary clock muxes are located in the center of the device. figure 2-12 shows the mux structure of the secondary clock routing. secondary clocks sc0 to sc3 are used for clock and control and sc4 to sc7 are used for high fan-out signals. figure 2-11. secondary clock regions xp2-40 i/o bank 0 i/o bank 7 i/o bank 2 i/o bank 3 i/o bank 6 i/o bank 1 i/o bank 5 i/o bank 4 secondary clock region 1 secondary clock region 2 secondary clock region 3 secondary clock region 4 secondary clock region 5 secondary clock region 6 secondary clock region 7 secondary clock region 8 vertical routing channel regional boundary dsp row regional boundary ebr row regional boundary ebr row regional boundary
2-14 architecture lattice semiconductor lattice xp2 family data sheet figure 2-12. secondary clock selection slice clock selection figure 2-13 shows the clock selections and figure 2-14 shows the control selections for slice0 through slice2. all the primary clocks and the four secondary clocks are routed to this clock selection mux. other signals, via routing, can be used as clock inputs to the slices. slice controls are generated from the secondary clocks or other signals connected via routing. if none of the signals are selected for both clock and control, then the default value of the mux output is 1. slice 3 does not have any registers; therefore it does not have the clock or control muxes. figure 2-13. slice0 through slice2 clock selection sc0 sc1 sc2 sc3 sc4 sc5 24:1 24:1 24:1 sc6 sc7 24:1 24:1 24:1 24:1 24:1 4 secondary clocks/ce/lsr (sc0 to sc3) per region clock/control secondary clock feedlines: 8 pios + 16 routing high fan-out data 4 high fan-out data signals (sc4 to sc7) per region clock to slice primary clock secondary clock routing vcc 8 4 12 1 25:1
2-15 architecture lattice semiconductor lattice xp2 family data sheet figure 2-14. slice0 through slice2 control selection edge clock routing latticexp2 devices have eight high-speed edge clocks th at are intended for use with the pios in the implementa- tion of high-speed interfaces. each device has two edge clocks per edge. figure 2-15 shows the selection muxes for these clocks. figure 2-15. edge clock mux connections slice control secondary clock routing vcc 3 12 1 16:1 left and right edge clocks eclk1 top and bottom edge clocks eclk1/ eclk2 clock input pad routing routing input pad gpll input pad gpll output clkop left and right edge clocks eclk2 routing input pad gpll input pad gpll output clkos (both muxes)
2-16 architecture lattice semiconductor lattice xp2 family data sheet sysmem memory latticexp2 devices contains a number of sysmem embe dded block ram (ebr). the ebr consists of 18 kbit ram with dedicated input and output registers. sysmem memory block the sysmem block can implement single port, dual port or pseudo dual port memories. each block can be used in a variety of depths and widths as shown in table 2-5. fifos can be implemented in sysmem ebr blocks by using support logic with pfus. the ebr block supports an optional pa rity bit for each data byte to facilitate parity check- ing. ebr blocks provide byte-enable support for configurations with18-bit and 36-bit data widths. table 2-5. sysmem block configurations bus size matching all of the multi-port memory modes support different widths on each of the ports. the ram bits are mapped lsb word 0 to msb word 0, lsb word 1 to msb word 1, and so on. although the word size and number of words for each port varies, this mapping scheme applies to each port. flashbak ebr content storage all the ebr memory in the latticexp2 is shadowed by fl ash memory. optionally, initia lization values for the mem- ory blocks can be defined using the la ttice isplever tools. the initialization values ar e loaded into the flash memory during device programming and into the sram at power up or whenever the device is reconfigured. this feature is ideal for the storage of a variety of information such as look-up tables and microprocessor code. it is also possible to write the curren t contents of the ebr memory back to flash memory. this capability is useful for the storage of data such as error codes and calibration information. for additional information on the flashbak capa- bility see tn1137, latticexp2 memory usage guide . memory mode configurations single port 16,384 x 1 8,192 x 2 4,096 x 4 2,048 x 9 1,024 x 18 512 x 36 true dual port 16,384 x 1 8,192 x 2 4,096 x 4 2,048 x 9 1,024 x 18 pseudo dual port 16,384 x 1 8,192 x 2 4,096 x 4 2,048 x 9 1,024 x 18 512 x 36
2-17 architecture lattice semiconductor lattice xp2 family data sheet figure 2-16. flashbak technology memory cascading larger and deeper blocks of rams can be created usin g ebr sysmem blocks. typically, the lattice design tools cascade memory transparently, bas ed on specific design inputs. single, dual and pseudo-dual port modes in all the sysmem ram modes the input data and address for the ports are registered at the input of the memory array. the output data of the memory is optionally registered at the output. ebr memory supports two forms of write behavior for single port or dual port operation: 1. normal ? data on the output appears only during a read cycle. during a write cycle, the data (at the current address) does not appear on the output. this mode is supported for all data widths. 2. write through ? a copy of the input data appears at the output of the same port during a write cycle. this mode is supported for all data widths. memory core reset the memory array in the ebr utilizes la tches at the a and b out put ports. these latches can be reset asynchro- nously or synchronously. rsta and rstb are local signal s, which reset the output latches associated with port a and port b respectively. gsrn, the global reset signal, resets both ports. the output data latches and associated resets for both ports are as shown in figure 2-17. figure 2-17. memory core reset flash ebr jtag / spi port fpga logic write from flash to ebr during configuration / write from ebr to flash on user command make infinite reads and writes to ebr write to flash during programming q set d l clr output data latches memory core port a[17:0] q set d port b[17:0] rstb gsrn pro g rammable disable rsta l clr
2-18 architecture lattice semiconductor lattice xp2 family data sheet for further information on the sysmem ebr block, please see tn1137, latticexp2 memory usage guide . ebr asynchronous reset ebr asynchronous reset or gsr (if used) can only be applied if all clock enables are low for a clock cycle before the reset is applied and released a clock cycle after the low-to-hi gh transition of the reset signal, as shown in figure 2-18. the gsr input to the ebr is always asynchronous. figure 2-18. ebr asynchronous reset (including gsr) timing diagram if all clock enables remain enabled, the ebr asynchronous reset or gsr may only be applied and released after the ebr read and write clock inputs are in a steady state condition for a minimum of 1/f max (ebr clock). the reset release must adhere to the ebr synchronous reset setup time before the next active read or write clock edge. if an ebr is pre-loaded during configuration, the gsr input must be disabled or the release of the gsr during device wake up must occur before the release of the device i/os becoming active. these instructions apply to all ebr ram and rom implementations. note that there are no reset restrictions if the ebr syn chronous reset is used and the ebr gsr input is disabled. sysdsp? block the latticexp2 family provides a sysdsp block making it id eally suited for low cost, high performance digital sig- nal processing (dsp) applications. typical functions used in these applications include bit correlators, fast fourier transform (fft) functions, finite impulse response (fir ) filter, reed-solomon encoder/decoder, turbo encoder/ decoder and convolutional encoder/decoder. these complex signal processing functions use similar building blocks such as multiply-adders and multiply-accumulators. sysdsp block approach comp are to general dsp conventional general-purpose dsp chips typically contain one to four (multiply and accumulate) mac units with fixed data-width multipliers; this leads to limited parallelism and limited throughput. their throughput is increased by higher clock speeds. the latticexp2 family, on the other hand, has many dsp blocks that support different data- widths. this allows the designer to us e highly parallel implementations of dsp functions. the designer can opti- mize the dsp performance vs. area by choosing appropriate levels of parallelism. figure 2-19 compares the fully serial and the mixed parallel and serial implementations. reset clock clock enable
2-19 architecture lattice semiconductor lattice xp2 family data sheet figure 2-19. comparison of general dsp and latticexp2 approaches sysdsp block capabilities the sysdsp block in the latticexp2 family supports four functional elements in three 9, 18 and 36 data path widths. the user selects a function element for a dsp block and then selects the width and type (signed/unsigned) of its operands. the operands in the latticexp2 family sysdsp blocks can be either signed or unsigned but not mixed within a function element. similarly, the operand widths cannot be mixed within a block. dsp elements can be concatenated. the resources in each sysdsp block can be configured to support the following four elements: ? mult (multiply) ? mac (multiply, accumulate) ? multaddsub (multiply, addition/subtraction) ? multaddsubsum (multiply, addition/subtraction, accumulate) the number of elements available in each block depends on the width selected from the three available options: x9, x18, and x36. a number of these elements are concatenat ed for highly parallel implementations of dsp functions. table 2-6 shows the capabilities of the block. table 2-6. maximum number of elements in a block some options are available in four elements. the input regist er in all the elements can be directly loaded or can be loaded as shift register from previous operand registers. by selecting ?dynamic operation? the following operations are possible: width of multiply x9 x18 x36 mult 841 mac 2 2 ? multaddsub 4 2 ? multaddsubsum 2 1 ? multiplier 0 x operand a operand b x operand a operand b x operand a operand b multiplier 1 multiplier k (k adds) output m/k loops single multiplier x operand a accumulator operand b m loops function implemented in general purpose dsp function implemented in latticexp2 m/k accumulate + +
2-20 architecture lattice semiconductor lattice xp2 family data sheet ? in the ?signed/unsigned? options the operands can be switched between signed and unsigned on every cycle. ? in the ?add/sub? option the accumulator can be switched between addition and subtraction on every cycle. ? the loading of operands can switch between parallel and serial operations. mult sysdsp element this multiplier element implements a multiply with no addition or accumulator nodes. the two operands, a and b, are multiplied and the result is available at the output. the user can enable the input/output and pipeline registers. figure 2-20 shows the mult sysdsp element. figure 2-20. mult sysdsp element multiplier x n m m n m n m n n m m+n m+n (default) clk (clk0,clk1,clk2,clk3) ce (ce0,ce1,ce2,ce3) rst(rst0,rst1,rst2,rst3) pipeline register input register multiplier multiplicand signed a shift register a in shift register b in shift register a out shift register b out output input data register a input data register b output register to multiplier input register signed b to multiplier
2-21 architecture lattice semiconductor lattice xp2 family data sheet mac sysdsp element in this case, the two operands, a and b, are multiplied and the result is added with the previous accumulated value. this accumulated value is available at the output. the user can enable the input and pipeline registers but the out- put register is always enabled. the output register is used to store the accumulated value. the accumulators in the dsp blocks in latticexp2 family can be initialized dynamically. a registered over flow signal is also available. the overflow conditions are provided later in this document. figure 2-21 shows the mac sysdsp element. figure 2-21. mac sysdsp multiplier x input data register a n m input data register b m n n n m n n m output register output register accumulator multiplier multiplicand signed a serial register b in serial register a in srob sroa output addn accumsload pipeline clk (clk0,clk1,clk2,clk3) ce (ce0,ce1,ce2,ce3) rst(rst0,rst1,rst2,rst3) input pipeline register input register pipeline register input register pipeline register to accumulator signed b pipeline input to accumulator to accumulator to accumulator overflow signal m+n (default) m+n+16 (default) m+n+16 (default) preload register register register register
2-22 architecture lattice semiconductor lattice xp2 family data sheet multaddsub sysdsp element in this case, the operands a0 and b0 are multiplied and the result is added/subtracted with the result of the multi- plier operation of operands a1 and b1. the user can enable the input, output and pipeline registers. figure 2-22 shows the multaddsub sysdsp element. figure 2-22. multaddsub multiplier multiplier add/sub pipe reg pipe reg n m m n m n m n n m m+n (default) m+n+1 (default) m+n+1 (default) m+n (default) x x n m m n m n n m multiplier b0 multiplicand a0 multiplier b1 multiplicand a1 signed a shift register a in shift register b in shift register a out shift register b out output addn pipeline register clk (clk0,clk1,clk2,clk3) ce (ce0,ce1,ce2,ce3) rst (rst0,rst1,rst2,rst3) input register pipeline register input register pipeline register pipeline register pipe reg signed b pipeline register input register input data register a input data register a input data register b input data register b output register to add/sub to add/sub to add/sub
2-23 architecture lattice semiconductor lattice xp2 family data sheet multaddsubsum sysdsp element in this case, the operands a0 and b0 are multiplied and the result is added/subtracted with the result of the multi- plier operation of operands a1 and b1. additionally the operands a2 and b2 are multiplied and the result is added/ subtracted with the result of the multiplier operation of operands a3 and b3. the result of both addition/subtraction are added in a summation block. the user can enable the input, output and pipeline registers. figure 2-23 shows the multaddsubsum sysdsp element. figure 2-23. multaddsubsum clock, clock enable and reset resources global clock, clock enable (ce) and reset (rst) signals from routing are available to every dsp block. from four clock sources (clk0, clk1, clk2, clk3) one clock is selected for each input register, pipeline register and output multiplier add/sub0 x n m m+n (default) m+n (default) m+n+1 m+n+2 m+n+2 m+n+1 m+n (default) m+n (default) m n m n m n n m x n n m n n m multiplier multiplier multiplier add/sub1 x n m m n m n m n n m x n m m n m n n m sum multiplier b0 multiplicand a0 multiplier b1 multiplicand a1 multiplier b2 multiplicand a2 multiplier b3 multiplicand a3 signed a shift register b in output addn0 pipeline register clk (clk0,clk1,clk2,clk3) ce (ce0,ce1,ce2,ce3) rst(rst0,rst1,rst2,rst3) input register pipeline register input register to add/sub0 to add/sub0, add/sub1 pipeline register signed b pipeline register input register to add/sub0, add/sub1 pipeline register input register to add/sub1 addn1 pipeline register pipeline register pipeline register shift register a in shift register b out shift register a out input data register a input data register a input data register a input data register a input data register b input data register b input data register b input data register b output register
2-24 architecture lattice semiconductor lattice xp2 family data sheet register. similarly, ce and rst are selected from their four respective sources (ce0, ce1, ce2, ce3 and rst0, rst1, rst2, rst3) at each input register, pipeline register and output register. signed and unsigned with different widths the dsp block supports other widths, in addition to x9, x18 and x36 widths, of signed and unsigned multipliers. for unsigned operands, unused upper data bits should be f illed to create a valid x9, x1 8 or x36 operand. for signed two?s complement operands, sign extension of the most significant bit should be performed until x9, x18 or x36 width is reached. table 2-7 provides an example of this. table 2-7. sign extension example overflow flag from mac the sysdsp block provides an overflow output to indicate that the accumulator has overflowed. ?roll-over? occurs and an overflow signal is indicated when any of the following is true: two unsigned numbers are added and the result is a smaller number than the accumulator, two positive numbers are added with a negative sum or two nega- tive numbers are added with a positive sum. note that when overflow occurs the overflow flag is present for only one cycle. by counting these overflow pulses in fpga logic, larger accumulators can be constructed. the condi- tions for the overflow signal for signed and unsigned operands are listed in figure 2-24. figure 2-24. accumulator overflow/underflow number unsigned unsigned 9-bit unsigned 18-bit signed two?s complement signed 9 bits two?s complement signed 18 bits +5 0101 000000101 000000000000000101 0101 000000101 000000000000000101 -6 n/a n/a n/a 1010 111111010 111111111111111010 000000000 000000001 000000010 000000011 111111101 111111110 111111111 overflow signal is generated for one cycle when this boundary is crossed 0 +1 +2 +3 -3 -2 -1 unsigned operation signed operation 255 254 253 252 -254 -255 -256 000000000 000000001 000000010 000000011 111111101 111111110 111111111 carry signal is generated for one cycle when this boundary is crossed 0 1 2 3 509 510 511 255 254 253 252 258 257 256 011111100 011111101 011111110 011111111 100000000 100000001 100000010 011111100 011111101 011111110 011111111 100000000 100000001 100000010
2-25 architecture lattice semiconductor lattice xp2 family data sheet ipexpress? the user can access the sysdsp block via the isplever ipex press tool, which provides the option to configure each dsp module (or group of modules), or by direct hdl instantiation. in addition, lattice has partnered with the mathworks ? to support instanti ation in the simulink ? tool, a graphical simulation environment. simulink works with isplever to dramatically shorten the dsp design cycle in lattice fpgas. optimized dsp functions lattice provides a library of optimized dsp ip function s. some of the ip cores planned for the latticexp2 dsp include the bit correlator, fft functions, fir filter, re ed-solomon encoder/decoder, turbo encoder/decoder and convolutional encoder/decoder. please contact lattice to obtain the latest list of available dsp ip cores. resources available in the latticexp2 family table 2-8 shows the maximum number of multipliers for each member of the latticexp2 family. table 2-9 shows the maximum available ebr ram blocks and serial tag me mory bits in each latticexp2 device. ebr blocks, together with distributed ram can be used to store variables locally for fast dsp operations. table 2-8. maximum number of dsp blocks in the latticexp2 family table 2-9. embedded sram/tag memory in the latticexp2 family latticexp2 dsp performance table 2-10 lists the maximum performanc e in millions of mac (mmac) operatio ns per second for each member of the latticexp2 family. table 2-10. dsp performance for further information on the sysdsp block, please see tn1140, latticexp2 sysdsp usage guide . device dsp block 9x9 multiplier 18 x18 multiplier 36x36 multiplier xp2-5 3 24 12 3 xp2-8 4 32 16 4 xp2-17 5 40 20 5 xp2-30 7 56 28 7 xp2-40 8 64 32 8 device ebr sram block total ebr sram (kbits) tag memor y (bits) xp2-5 9 166 632 xp2-8 12 221 768 xp2-17 15 276 2184 xp2-30 21 387 2640 xp2-40 48 885 3384 device dsp block dsp performance mmac xp2-5 3 3,900 xp2-8 4 5,200 xp2-17 5 6,500 xp2-30 7 9,100 xp2-40 8 10,400
2-26 architecture lattice semiconductor lattice xp2 family data sheet programmable i/o cells (pic) each pic contains two pios connected to their respecti ve sysio buffers as shown in figure 2-25. the pio block supplies the output data (do) and the tri-state control signal (to) to the sysio buffer and receives input from the buffer. table 2-11 provides the pio signal list. figure 2-25. pic diagram two adjacent pios can be joined to provide a differential i/o pair (labeled as ?t? and ?c?) as shown in figure 2-25. the pad labels ?t? and ?c? distinguish the two pios. approximately 50% of the pio pairs on the left and right edges of the device can be configured as true lvds outputs. all i/o pairs can operate as inputs. opos1 oneg1 td inck 2 indd inff ipos0 ipos1 clk ce lsr gsrn clk1 clk0 ceo cei sysio buffer pada ?t? pad b ?c? lsr gsr eclk1 ddrclkpol 1 1. signals are available on left/right/bottom edges only. 2. selected blocks. iold0 di tristate register block output register block input register block control muxes piob pioa opos0 opos2 1 oneg0 oneg2 1 dqsxfer 1 dqs del qpos1 1 qneg1 1 qneg0 1 qpos0 1 iolt0 eclk2
2-27 architecture lattice semiconductor lattice xp2 family data sheet table 2-11. pio signal list pio the pio contains four blocks: an input register block, output register block, tristate register block and a control logic block. these blocks contain registers for operating in a variety of modes along with necessary clock and selection logic. input register block the input register blocks for pios contain delay elements and registers that can be used to condition high-speed interface signals, such as ddr memory interfaces and source sy nchronous interfaces, befo re they are passed to the device core. figure 2-26 shows the diagram of the input register block. input signals are fed from the sysio buffer to the input register block (as signal di). if desired, the input signal can bypass the register and delay elements and be used directly as a combinatorial signal (indd), a clock (inck) and, in selected blocks, the input to the dqs delay block. if an input delay is desired, designers can select either a fixed delay or a dynamic delay del[3:0]. the delay, if selected, reduces input register hold time requirements when using a global clock. the input block allows three modes of operation. in the single data rate (sdr) mode, the data is registered, by one of the registers in the sdr sync register block, with the system clock. in ddr mode two registers are used to sample the data on the positive and negative edges of the dqs signal which creates two data streams, d0 and d2. d0 and d2 are synchronized with the system clock before en tering the core. further information on this topic can be found in the ddr memory support section of this data sheet. by combining input blocks of the complementary pios and sharing registers from output blocks, a gearbox function can be implemented, that takes a double data rate signal applied to pioa and converts it as four data streams, ipos0a, ipos1a, ipos0b and ipos1b. figure 2-26 shows the diagram using this gearbox function. for more information on this topic, please see tn1138, latticexp2 high speed i/o interface . name type description ce control from the core clock enables for input and output block flip-flops clk control from the core system clocks for input and output blocks eclk1, eclk2 control from the core fast edge clocks lsr control from the core local set/reset gsrn control from routing global set/reset (active low) inck 2 input to the core input to primary clock network or pll reference inputs dqs input to pio dqs signal from logic (routing) to pio indd input to the core unregistered data input to core inff input to the core registered input on positive edge of the clock (clk0) ipos0, ipos1 input to the core double data rate registered inputs to the core qpos0 1 , qpos1 1 input to the core gearbox pipelined inputs to the core qneg0 1 , qneg1 1 input to the core gearbox pipelined inputs to the core opos0, oneg0, opos2, oneg2 output data from the core output signal s from the core for sdr and ddr operation opos1 oneg1 tristate control from the core signal s to tristate register block for ddr operation del[3:0] control from the core dy namic input delay control bits td tristate control from the core tristate signal from the core used in sdr operation ddrclkpol control from clock polarity bus controls the pola rity of the clock (clk0) that feed the ddr input block dqsxfer control from core controls signal to the output block 1. signals available on left/right/bottom only. 2. selected i/o.
2-28 architecture lattice semiconductor lattice xp2 family data sheet the signal ddrclkpol controls the pola rity of the clock used in the synchr onization registers. it ensures ade- quate timing when data is transferred from the dqs to system clock domain. for further discussion on this topic, see the ddr memory section of this data sheet. figure 2-26. input register block output register block the output regist er block provides the ability to register signals from the core of the device before they are passed to the sysio buffers. the blocks on the pios on the left, right and bottom contain regist ers for sdr operation that are combined with an additional latch for ddr operation. figure 2-27 shows the diagram of the output register block for pios. in sdr mode, oneg0 feeds one of the flip-flops that then feeds the output. the flip-flop can be configured as a d- type or latch. in ddr mode, oneg0 and opos0 are fed into registers on the positive edge of the clock. at the next clock cycle the registered opos0 is latched. a multiplexer running off the same clock cycle selects the correct reg- ister to feed the output (d0). by combining output blocks of the complementary pios and sharing some registers from input blocks, a gearbox function can be implemented, to take four data streams oneg0a, oneg1a, oneg1b and oneg1b. figure 2-27 clock transfer registers clock transfer registers sdr & sync registers d1 d2 d0 ddr registers d q d-type d q d-type d q d-type d q d-type /latch d q d-type 0 1 d q d q 0 1 fixed delay dynamic delay di (from sysio buffer) di (from sysio buffer) inck 2 indd ipos0a qpos0a ipos1a qpos1a del [3:0] clk0 (of pio a) delayed dqs 0 1 clka dq d q d q 0 1 0 1 d q d q 0 1 d q d q 0 1 fixed delay dynamic delay inck 2 indd ipos0b qpos0b ipos1b qpos1b del [3:0] clk0 (of pio b) delayed dqs clkb /latch true pio (a) in lvds i/o pair comp pio (b) in lvds i/o pair d-type 1 d-type 1 d-type /latch d-type /latch d-type 1 d-type 1 from routing to routing d1 d2 d0 ddr registers sdr & sync registers 0 1 ddrsrc gearbox configuration bit ddrclkpol ddrclkpol 1. shared with output register 2. selected pio. note: simplified version does not show ce and set/reset details from routing to routing to dqs delay block 2 to dqs delay block 2 d-type d-type d-type
2-29 architecture lattice semiconductor lattice xp2 family data sheet shows the diagram using this gearbox function. for more information on this topic, see tn1138, latticexp2 high speed i/o interface . figure 2-27. output and tristate block clock transfer registers oneg1 clka to opos1 from routing td dq dq dq 0 1 0 1 0 1 dq dq dq 0 1 0 1 d q d-type * d q latch d q 0 1 0 1 0 1 0 1 oneg0 opos0 do programmable control programmable control 0 1 eclk1 eclk2 clk1 tristate logic tristate logic output logic true pio (a) in lvds i/o pair to sysio buf fer oneg1 clkb to opos1 from routing td d q d q d q 0 1 0 1 0 1 d q d-type /latch d-type /latch d-type /latch d-type /latch dq dq 0 1 0 1 d q dq latch d-type d-type latch latch d-type latch d-type latch dq oneg0 opos0 do eclk1 eclk2 clk1 output logic to sysio buff er comp pio (b) in lvds i/o pair (clkb) (clka) d-type * d-type* d-type* clock transfer registers ddr output registers ddr output registers * shared with input register note: simplified version does not show ce and set/reset details 0 1 dqsxfer dqsxfer 0 1 0 1
2-30 architecture lattice semiconductor lattice xp2 family data sheet tristate register block the tristate register block prov ides the ability to register tr i-state control signals from t he core of the device before they are passed to the sysio buffers. the block contains a register for sdr operation and an additional latch for ddr operation. figure 2-27 shows the tristate register block with the output block in sdr mode, oneg1 feeds one of the flip-flops that then feeds the output. the flip-flop can be configured as d- type or latch. in ddr mode, oneg1 and opos1 are fed into registers on the positive edge of the clock. then in the next clock the registered opos1 is latched. a multiplexer running off the same clock cycle selects the correct register for feeding to the output (d0). control logic block the control logic block allows the selection and modification of control signals for use in the pio block. a clock sig- nal is selected from general purpose routing, eclk1, eclk2 or a dqs signal (from the programmable dqs pin) and is provided to the input register block. the clock can optionally be inverted. ddr memory support pics have additional circuitry to allow implementation of high speed source synchronous and ddr memory inter- faces. pics have registered element s that support ddr memory interfaces. inte rfaces on the left and right edges are designed for ddr memories that support 16 bits of data, whereas interfaces on the top and bottom are designed for memories that support 18 bits of data. one of every 16 pios on the left and right and one of every 18 pios on the top and bottom contain delay elem ents to facilitate the gene ration of dqs signals. the dqs signals feed the dqs buses which span the set of 16 or 18 pios. figure 2-28 and figure 2-29 show the dqs pin assignments in each set of pios. the exact dqs pins are shown in a dual function in the lo gic signal connections table in this data sheet. addi- tional detail is provided in the signal descriptions table. the dqs signal from the bus is used to strobe the ddr data from the memory into input register blocks. for additional information on using ddr memory support please see tn1138, latticexp2 high speed i/o interface .
2-31 architecture lattice semiconductor lattice xp2 family data sheet figure 2-28. dqs input routing (left and right) figure 2-29. dqs input routing (top and bottom) pio b pio a pio b pio a assigned dqs pin dqs delay sysio buffer pada "t" padb "c" lvds pair pada "t" padb "c" lvds pair pio a pio b pada "t" padb "c" lvds pair pio a pio b pada "t" padb "c" lvds pair pio a pio b pada "t" padb "c" lvds pair pio a pio b pada "t" padb "c" lvds pair pio a pio b pada "t" padb "c" lvds pair pio a pio b pada "t" padb "c" lvds pair pio b pio a pio b pio a assigned dqs pin dqs delay sysio buffer pada "t" padb "c" lvds pair pada "t" padb "c" lvds pair pio a pio b pada "t" padb "c" lvds pair pio a pio b pada "t" padb "c" lvds pair pio a pio b pada "t" padb "c" lvds pair pio a pio b pada "t" padb "c" lvds pair pio a pio b pada "t" padb "c" lvds pair pio b pio a pada "t" padb "c" lvds pair pio a pio b pada "t" padb "c" lvds pair
2-32 architecture lattice semiconductor lattice xp2 family data sheet dll calibrated dqs delay block source synchronous interfaces generally require the input clock to be adjusted in order to correctly capture data at the input register. for most interfaces a pll is used for this adjustment. however, in ddr memories the clock, referred to as dqs, is not free-running, and this approach cannot be used. the dqs delay block provides the required clock alignment fo r ddr memory interfaces. the dqs signal (selected pios only, as shown in figure 2-30) feeds from the pad through a dqs delay element to a dedicated dqs routing resource. the dqs signal also feeds polarity control logic which controls the polarity of the clock to the sync registers in the input register blocks. figure 2-30 and figure 2-31 show how the dqs transi- tion signals are routed to the pios. the temperature, voltage and process variations of the dqs delay block are compensated by a set of 6-bit bus cal- ibration signals from two dedicated dlls (ddr_dll) on opposite sides of the device. each dll compensates dqs delays in its half of the device as shown in figure 2-30. the dll loop is compensated for temperature, volt- age and process variations by the system clock and feedback loop. figure 2-30. edge clock, dll calibr ation and dqs local bus distribution i/o bank 5 i/o bank 6 i/o bank 7 i/o bank 2 i/o bank 3 i/o bank 4 i/o bank 0 i/o bank 1 ddr_dll (right) ddr_dll (left) eclk1 eclk2 delayed dqs polarity control dqsxfer dqs delay control bus dqs input spans 18 pios top & bottom sides spans 16 pios left & right sides
2-33 architecture lattice semiconductor lattice xp2 family data sheet figure 2-31. dqs local bus polarity control logic in a typical ddr memory interface design, the phase relationship between the incoming delayed dqs strobe and the internal system clock (during the read cycle) is unknown. the latticexp2 family contains dedicated circuits to transfer data between these domains. to prevent set-up and hold violations, at the domain transfer between dqs (delayed) and the system clock, a clock polarity selector is used. this changes the edge on which the data is regis- tered in the synchronizing registers in the input register block and requires evaluation at the start of each read cycle for the correct clock polarity. prior to the read operation in ddr me mories, dqs is in tristate (pulled by termination). the ddr memory device drives dqs low at the start of the preamble state. a dedicated circuit detects this transition. this signal is used to control the polarity of the clock to the synchronizing registers. sysio buffer ddr datain pad di clk1 cei pio sysio buffer gsr dqs to sync reg. dqs to ddr reg. dqs strobe pad pio dqsdel polarity control logic dqs calibration bus from dll dqsxfer output register block input register block dqsxfer dcntl[6:0] polarit y control dqs di dqsxferdel* dqsxfer dcntl[6:0] *dqsxferdel shifts eclk1 by 90% and is not associated with a particular pio. dcntl[6:0] eclk1 clk1 eclk2 eclk1
2-34 architecture lattice semiconductor lattice xp2 family data sheet dqsxfer latticexp2 devices provide a dqsxfer signal to the output buffer to assist it in data transfer to ddr memories that require dqs strobe be shifted 90 o . this shifted dqs strobe is generated by the dqsdel block. the dqsxfer signal runs the span of the data bus. sysio buffer each i/o is associated with a flexible buffer referred to as a sysio buffer. these buffers are arranged around the periphery of the device in groups referred to as banks. the sysio buffers allow users to implement the wide variety of standards that are found in today?s systems including lvcm os, sstl, hstl, lvds and lvpecl. sysio buffer banks latticexp2 devices have eight sysio buffer banks for user i/os arranged two per side. each bank is capable of sup- porting multiple i/o standards. each sysio bank has its own i/o supply voltage (v ccio ). in addition, each bank has voltage references, v ref1 and v ref2 , that allow it to be completely independent from the others. figure 2-32 shows the eight banks and their associated supplies. in latticexp2 devices, single-ended output buffers and ratioed input buffers (lvttl, lvcmos and pci) are pow- ered using v ccio . lvttl, lvcmos33, lvcmos25 and lvcmos12 can also be set as fixed threshold inputs inde- pendent of v ccio . each bank can support up to two separate v ref voltages, v ref1 and v ref2 , that set the threshold for the refer- enced input buffers. some dedicated i/o pins in a bank c an be configured to be a reference voltage supply pin. each i/o is individually configurable based on the bank?s supply and reference voltages. figure 2-32. latticexp2 banks v ref1(2) gnd b ank 2 v ccio2 v ref2(2) v ref1(3) gnd ban k 3 v ccio3 v ref2(3) v ref1(7) gnd ban k 7 v ccio7 v ref2(7) v ref1(6) gnd ban k 6 v ccio6 v ref2(6) bank 5 bank 4 v ref 1 (0 ) g nd bank 0 v cci o0 v ref2(0) v re f1 (1 ) gnd bank 1 v cc io1 v ref2(1 ) lef t right top v ref1(5 ) gnd v ccio5 v ref 2(5 ) v ref1(4) gnd v ccio4 v ref 2(4) bottom
2-35 architecture lattice semiconductor lattice xp2 family data sheet latticexp2 devices contain two types of sysio buffer pairs. 1. top and bottom (banks 0, 1, 4 and 5) sysio buffer pairs (single-ended outputs only) ? the sysio buffer pairs in the top banks of the device consist of two single-ended output drivers and two sets of single-ended input buffers (both ratioed and referenced). one of the referenced input buffers can also be con - figured as a differential input. ? ? the two pads in the pair are described as ?true? and ?c omp?, where the true pad is associated with the positive side of the differential input buffer and the comp (complementary) pad is associated with the negative side of the differential input buffer. ? ? only the i/os on the top and bottom banks have programmable pci clamps. 2. left and right (banks 2, 3, 6 and 7) sysio buffer pairs (50% differential and 100% single-ended outputs) ? the sysio buffer pairs in the left and right banks of the device consist of two single-ended output drivers, two sets of single-ended input buffers (both ratioed and referenced) and one differential output driver. one of the ref- erenced input buffers can also be configured as a differential input. ? ? the two pads in the pair are described as ?true? and ?c omp?, where the true pad is associated with the positive side of the differential i/o, and the comp pad is associated with the negative side of the differential i/o. ? ? lvds differential output drivers are available on 50% of the buffer pairs on the left and right banks. typical sysio i/o beha vior during power-up the internal power-on-reset (por) signal is deactivated when v cc and v ccaux have reached satisfactory levels. after the por signal is deacti vated, the fpga core logic becomes active. it is the user?s resp onsibility to ensure that all other v ccio banks are active with valid input logic levels to properly control the output logic states of all the i/o banks that are critical to the application. for more information on controlling the output logic state with valid input logic levels during power-up in latticexp2 devices, please see tn1136, latticexp2 sysio usage guide . the v cc and v ccaux supply the power to the fpga core fabric, whereas the v ccio supplies power to the i/o buf- fers. in order to simplify system design while providing consistent and predictable i/o behavior, it is recommended that the i/o buffers be powered-up prior to the fpga core fabric. v ccio supplies should be powered-up before or together with the v cc and v ccaux supplies. supported sysio standards the latticexp2 sysio buffer supports both single-ended and differential standards. single-ended standards can be further subdivided into lvcmos, lvttl and other standards. the buffers support the lvttl, lvcmos 1.2v, 1.5v, 1.8v, 2.5v and 3.3v standards. in the lvcmos and lvttl modes, the buffer has individual configuration options for drive strength, bus maintenance (weak pull-up, weak pull-down, or a bus-keeper latch) and open drain. other single-ended standards supported include sstl and hstl. differential standards supported include lvds, mlvds, blvds, lvpecl, rsds, differential sstl and diff erential hstl. tables 2-12 and 2-13 show the i/o stan- dards (together with their supply and reference voltages) supported by latticexp2 devices. for further information on utilizing the sysio buffer to support a variety of standards please see tn1136, latticexp2 sysio usage guide .
2-36 architecture lattice semiconductor lattice xp2 family data sheet table 2-12. supported input standards input standard v ref (nom.) v ccio 1 (nom.) single ended interfaces lv t t l ? ? lv c m o s 3 3 ? ? lv c m o s 2 5 ? ? lv c m o s 1 8 ? 1 . 8 lv c m o s 1 5 ? 1 . 5 lv c m o s 1 2 ? ? pci33 ? ? hstl18 class i, ii 0.9 ? hstl15 class i 0.75 ? sstl33 class i, ii 1.5 ? sstl25 class i, ii 1.25 ? sstl18 class i, ii 0.9 ? differential interfaces differential sstl18 class i, ii ? ? differential sstl25 class i, ii ? ? differential sstl33 class i, ii ? ? differential hstl15 class i ? ? differential hstl18 class i, ii ? ? lvds, mlvds, lvpecl, blvds, rsds ? ? 1. when not specified, v ccio can be set anywhere in the valid operating range (page 3-1).
2-37 architecture lattice semiconductor lattice xp2 family data sheet table 2-13. supported output standards hot socketing latticexp2 devices have been carefully designed to ensure predictable behavior during power-up and power- down. power supplies can be sequenced in any order. during power-up and power-down sequences, the i/os remain in tri-state until the power supply voltage is high enough to ensure reliable operation. in addition, leakage into i/o pins is controlled to within specified limits. this allows for ea sy integration with the rest of the system. these capabilities make the lattice xp2 ideal for many multiple powe r supply and hot-swap applications. ieee 1149.1-compliant boundary scan testability all latticexp2 devices have boundary scan cells that are accessed through an ieee 1149.1 compliant test access port (tap). this allows functional testing of the circuit board, on which the device is mounted, through a serial scan path that can access all critical logic nodes. internal registers are linked internally, allowing test data to be shifted in output standard drive v ccio (nom.) single-ended interfaces lvttl 4ma, 8ma, 12ma, 16ma, 20ma 3.3 lvcmos33 4ma, 8ma, 12ma 16ma, 20ma 3.3 lvcmos25 4ma, 8ma, 12ma, 16ma, 20ma 2.5 lvcmos18 4ma, 8ma, 12ma, 16ma 1.8 lvcmos15 4ma, 8ma 1.5 lvcmos12 2ma, 6ma 1.2 lvcmos33, open drain 4ma, 8ma, 12ma 16ma, 20ma ? lvcmos25, open drain 4ma, 8ma, 12ma 16ma, 20ma ? lvcmos18, open drain 4ma, 8ma, 12ma 16ma ? lvcmos15, open drain 4ma, 8ma ? lvcmos12, open drain 2ma, 6ma ? pci33 n/a 3.3 hstl18 class i, ii n/a 1.8 hstl15 class i n/a 1.5 sstl33 class i, ii n/a 3.3 sstl25 class i, ii n/a 2.5 sstl18 class i, ii n/a 1.8 differential interfaces differential sstl33, class i, ii n/a 3.3 differential sstl25, class i, ii n/a 2.5 differential sstl18, class i, ii n/a 1.8 differential hstl18, class i, ii n/a 1.8 differential hstl15, class i n/a 1.5 lv d s 1, 2 n/a 2.5 mlvds 1 n/a 2.5 blvds 1 n/a 2.5 lvpecl 1 n/a 3.3 rsds 1 n/a 2.5 lvcmos33d 1 4ma, 8ma, 12ma, 16ma, 20ma 3.3 1. emulated with external resistors. for more detail, please see tn1138, latticexp2 high speed i/o interface . 2. on the left and right edges, lvds outputs are supported with a dedi cated differential output driver on 50% of the i/os. this solution does not require external resistors at the driver.
2-38 architecture lattice semiconductor lattice xp2 family data sheet and loaded directly onto test nodes, or test data to be captured and shifted out for verification. the test access port consists of dedicated i/os: tdi, tdo, tck and tms. the test access port has its own supply voltage v ccj and can operate with lvcmos3.3, 2.5, 1.8, 1.5 and 1.2 standards. for more information, please see tn1141, latticexp2 sysconfig usage guide . flexiflash device configuration the latticexp2 devices combine flash and sram on a single chip to provide users wit h flexibility in device pro- gramming and configuration. figure 2-33 provides an overview of the arrangement of flash and sram configura- tion cells within the device. the remain der of this section provides an overvi ew of these capabilities. see tn1141, latticexp2 sysconfig usage guide for a more detailed description. figure 2-33. overview of flash and sram co nfiguration cells within latticexp2 devices at power-up, or on user command, data is transferred from the on-chip flash memory to the sram configuration cells that control the operation of th e device. this is done with massively parallel buses enabling the parts to oper- ate within microseconds of the power supplies reaching valid levels; this capability is referred to as instant-on. the on-chip flash enables a single-chip solution eliminatin g the need for external boot memory. this flash can be programmed through either the jtag or slave spi ports of the device. the sram configuration space can also be infinitely reconfigured thro ugh the jtag and master spi ports. the jtag port is ieee 1149.1 and ieee 1532 com- pliant. as described in the ebr section of the data sheet, the flashbak ca pability of the par ts enables the co ntents of the ebr blocks to be written back into the flash storage area without erasing or reprogramming other aspects of the device configuration. serial tag memory is also available to allow the storage of small amounts of data such as calibration coefficients and error codes. for applications where security is important, the lack of an external bitstream provides a solution that is inherently more secure than sram only fpgas. this is further enhanc ed by device locking. the device can be in one of three modes: ebr blocks flash memory ebr blocks sram configuration bits massively parallel data transfer instant-on flash for single-chip solution flashbak for ebr storage decryption and device lock spi and jtag tag memory device lock for design security
2-39 architecture lattice semiconductor lattice xp2 family data sheet 1. unlocked 2. key locked ? presenting the key through the programming interface allows the device to be unlocked. 3. permanently locked ? the device is permanently locked. to further complement the security of the device a one time programmable (otp) mode is available. once the device is set in this mode it is not possible to erase or re-program the flash portion of the device. serial tag memory latticexp2 devices offer 0.6 to 3.3kbits of flash memory in the form of serial tag memory. the tag memory is an area of the on-chip flash that can be used for non-volatile storage including electronic id codes, version codes, date stamps, asset ids and calibration settings. a block diagram of the tag memory is shown in figure 2-34. the tag memory is accessed in the same way as external spi flash and it can be read or programmed either through jtag, an external slave spi port, or directly from fpga logic. to read the tag memory, a start address is speci- fied and the entire tag memory contents are read sequentially in a first-in-first-out manner. the tag memory is independent of the flash used for device configuration an d given its use for general-purpose storage functions is always accessible regardless of the device security settings. for more information, see tn1137, latticexp2 mem- ory usage guide and tn1141, latticexp2 sysconfig usage guide . figure 2-34. serial tag memory diagram live update technology many applications require field updates of the fpga. latticexp2 devices provide three features that enable this configuration to be done in a secure and failsafe manner while minimizing impact on system operation. 1. decryption support ? latticexp2 devices provide on-chip, non-volatile key storage to support decryption of a 128-bit aes encrypted bitstream, securing designs and deterring design piracy. 2. transfr (transparent field reconfiguration) ? transfr i/o (tfr) is a unique lattice technology that allows users to update their logic in the field without interrupting system operation using a single ispvm command. transfr i/o allows i/o states to be frozen dur- ing device configuration. this allows the device to be field updated with a mini mum of system disruption and downtime. for more information please see tn1087, minimizing system interruption during configuration using transfr technology . 3. dual boot image support ? dual boot images are supported for applications requiring reliable remote updates of configuration data for the system fpga. after the system is running with a basic configuration, a new boot image can be downloaded remotely and stored in a separate location in the configuration storage device. any time after the update the latticexp2 can be re-booted from this new configuration file. if there is a problem such as corrupt data during download or incorrect version number with this new boot image, the latticexp2 device can revert back to the flash jtag fpga logic external slave spi port jtag fpga logic external slave spi port tdi tdo data shift register flash memory array sequential address counter
2-40 architecture lattice semiconductor lattice xp2 family data sheet original backup configuration and tr y again. this all can be done without power cycling the system. for more information please see tn1144, latticexp2 dual boot usage guide . for more information on device configuration, please see tn1141, latticexp2 sysconfig usage guide . soft error detect (sed) support latticexp2 devices have dedicated logic to perform cyclic redundancy code (crc) checks. during configuration, the configuration data bitstream can be checked with the crc logic block. in addition, latticexp2 devices can be programmed for checking soft errors in sram. the sed operation can run in the background during user mode (normal operation). in the event a soft error occurs, the device can be programmed to either reload from a known good boot image (from internal flash or external spi memory) or generate an error signal. for further information on sed support, please see tn1130, latticexp2 soft error dete ction (sed) usage guide . on-chip oscillator every latticexp2 device has an internal cmos oscillator that is used to derive a mast er clock (cclk) for configu- ration. the oscillator and cclk run continuously and are ava ilable to user logic after co nfiguration is complete. the available cclk frequencies are listed in table 2-14. when a different cclk frequency is selected during the design process, the following sequence takes place: 1. device powers up with the default cclk frequency. 2. during configuration, users select a different cclk frequency. 3. cclk frequency changes to the selected frequency after clock configuration bits are received. this internal cmos oscillator is availabl e to the user by routing it as an in put clock to the clock tree. for further information on the use of this oscillator for configuration or user mode, please see tn1141, latticexp2 syscon- fig usage guide . table 2-14. selectable cclks and oscillator frequencies during configuration and user mode cclk/oscillator (mhz) 2.5 1 3.1 2 4.3 5.4 6.9 8.1 9.2 10 13 15 20 26 32 40 54 80 3 163 3 1. software default oscillator frequency. 2. software default cclk frequency. 3. frequency not valid for cclk.
2-41 architecture lattice semiconductor lattice xp2 family data sheet density shifting the latticexp2 family is designed to ensure that different density devices in the same family and in the same pack- age have the same pinout. furthermore, the architecture ensures a high success rate when performing design migration from lower density devices to higher density devices. in many cases, it is also possible to shift a lower uti- lization design targeted for a high-density device to a lowe r density device. however, the exact details of the final resource utilization will impact t he likely success in each case.
www.latticesemi.com 3-1 ds1009 dc and switching_01.6 august 2008 data sheet ds1009 ? 2008 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. absolute maximum ratings 1, 2, 3 recommended operating conditions on-chip flash memory specifications supply voltage v cc . . . . . . . . . . . . . . . . . . . -0.5 to 1.32v supply voltage v ccaux . . . . . . . . . . . . . . . . -0.5 to 3.75v supply voltage v ccj . . . . . . . . . . . . . . . . . . -0.5 to 3.75v supply voltage v ccpll 4 . . . . . . . . . . . . . . . . -0.5 to 3.75v output supply voltage v ccio . . . . . . . . . . . -0.5 to 3.75v input or i/o tristate voltage applied 5 . . . . . . -0.5 to 3.75v storage temperature (ambient) . . . . . . . . . -65 to 150c junction temperature under bias (tj) . . . . . . . . . +125c 1. stress above those listed under the ?absol ute maximum ratings? may cause permanent damage to the device. functional operation of the device at these or any other conditions abov e those indicated in the operational sectio ns of this specification is not implied. 2. compliance with the lattice thermal management document is required. 3. all voltages referenced to gnd. 4. v ccpll only available on csbga, pqfp and tqfp packages. 5. overshoot and undershoot of -2v to (v ihmax + 2) volts is permitted for a duration of <20 ns. symbol parameter min. max. units v cc core supply voltage 1.14 1.26 v v ccaux 4 auxiliary supply voltage 3.135 3.465 v v ccpll 1 pll supply voltage 3.135 3.465 v v ccio 2, 3, 4 i/o driver supply voltage 1.14 3.465 v v ccj 2 supply voltage for ieee 1149.1 test access port 1.14 3.465 v t jcom junction temperature, commercial operation 0 85 c t jind junction temperature, industrial operation -40 100 c 1. v ccpll only available on csbga, pqfp and tqfp packages. 2. if v ccio or v ccj is set to 1.2v, they must be connected to the same power supply as v cc. if v ccio or v ccj is set to 3.3v, they must be con- nected to the same power supply as v ccaux . 3. see recommended voltages by i/o standard in subsequent table. 4. to ensure proper i/o behavior, v ccio must be turned off at the same time or earlier than v ccaux. symbol parameter max. units n progcyc flash programming cycles per t retention 10,000 cycles flash functional programming cycles 100,000 t retention data retention 20 years latticexp2 family data sheet dc and switching characteristics
3-2 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet hot socketing specifications 1, 2, 3, 4 dc electrical characteristics over recommended operating conditions symbol parameter condition min. typ. max. units i dk input or i/o leakage current 0 ? v in ? v ih (max.) ? ? +/-1 ma 1. insensitive to sequence of v cc , v ccaux and v ccio . however, assumes monotonic rise/fall rates for v cc , v ccaux and v ccio . 2. 0 ? v cc ? v cc (max), 0 ? v ccio ? v ccio (max) or 0 ? v ccaux ? v ccaux (max). 3. i dk is additive to i pu , i pw or i bh . 4. lvcmos and lvttl only. symbol parameter condition min. typ. max. units i il , i ih 1 input or i/o low leakage 0 ? v in ? v ccio ??10a v ccio ? v in ? v ih (max) ? ? 150 a i pu i/o active pull-up current 0 ? v in ? 0.7 v ccio -30 ? -150 a i pd i/o active pull-down current v il (max) ? v in ? v ccio 30 ? 210 a i bhls bus hold low sustaining current v in = v il (max) 30 ? ? a i bhhs bus hold high sustaining current v in = 0.7 v ccio -30 ? ? a i bhlo bus hold low overdrive current 0 ? v in ? v ccio ??210a i bhho bus hold high overdrive current 0 ? v in ? v ccio ??-150a v bht bus hold trip points v il (max) ? v ih (min) v c1 i/o capacitance 2 v ccio = 3.3v, 2.5v, 1.8v, 1.5v, 1.2v, v cc = 1.2v, v io = 0 to v ih (max) ?8?pf c2 dedicated input capacitance v ccio = 3.3v, 2.5v, 1.8v, 1.5v, 1.2v, v cc = 1.2v, v io = 0 to v ih (max) ?6?pf 1. input or i/o leakage current is measured wi th the pin configured as an input or as an i/o with the output driver tri-stated. it is not measured with the output driver active. bus maintenance circuits are disabled. 2. t a 25 o c, f = 1.0 mhz.
3-3 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet supply current (standby) 1, 2, 3, 4 over recommended operating conditions symbol parameter device typical 5 units i cc core power supply current xp2-5 14 ma xp2-8 18 ma xp2-17 24 ma xp2-30 35 ma xp2-40 45 ma i ccaux auxiliary power supply current 6 xp2-5 15 ma xp2-8 15 ma xp2-17 15 ma xp2-30 16 ma xp2-40 16 ma i ccpll pll power supply current (per pll) 0.1 ma i ccio bank power supply current (per bank) 2 ma i ccj v ccj power supply current 0.25 ma 1. for further information on s upply current, please see tn1139, power estimation and management for latticexp2 devices . 2. assumes all outputs are tristated, all inputs are configured as lvcmos and held at the v ccio or gnd. 3. frequency 0 mhz. 4. pattern represents a ?blank ? configuration data file. 5. t j = 25 o c, power supplies at nominal voltage. 6. in fpbga and ftbga packages the plls are connected to and powe red from the auxiliary power supply. for these packages, the actual auxiliary supply current is the sum of i ccaux and i ccpll. for csbga, pqfp and tq fp packages the plls are powered independent of the auxiliary power supply.
3-4 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet initialization supply current 1, 2, 3, 4, 5 over recommended operating conditions symbol parameter device typical (25c, max. supply) 6 units i cc core power supply current xp2-5 20 ma xp2-8 21 ma xp2-17 44 ma xp2-30 58 ma xp2-40 62 ma i ccaux auxiliary power supply current 7 xp2-5 67 ma xp2-8 74 ma xp2-17 112 ma xp2-30 124 ma xp2-40 130 ma i ccpll pll power supply current (per pll) 1.8 ma i ccio bank power supply current (per bank) 6.4 ma i ccj vccj power supply current 1.2 ma 1. for further information on supply current, please see tn1139, power estimation and management for latticexp2 devices . 2. assumes all outputs are trista ted, all inputs are configured as lvcmos and held at the v ccio or gnd. 3. frequency 0 mhz. 4. does not include additional current from by pass or decoupling capacit or across the supply. 5. a specific configuration pattern is used that scales with the size of the device; consists of 75% pfu ut ilization, 50% ebr, a nd 25% i/o con- figuration. 6. t j = 25c, power supplies at nominal voltage. 7. in fpbga and ftbga packages the plls are connected to and powe red from the auxiliary power s upply. for these packages, the ac tual auxiliary supply current is the sum of i ccaux and i ccpll. for csbga, pqfp and tqfp packages t he plls are powered independent of the auxiliary power supply.
3-5 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet programming and erase flash supply current 1, 2, 3, 4, 5 over recommended operating conditions symbol parameter device typical (25c, max. supply) 6 units i cc core power supply current xp2-5 17 ma xp2-8 21 ma xp2-17 28 ma xp2-30 36 ma xp2-40 50 ma i ccaux auxiliary power supply current 7 xp2-5 64 ma xp2-8 66 ma xp2-17 83 ma xp2-30 87 ma xp2-40 88 ma i ccpll pll power supply current (per pll) 0.1 ma i ccio bank power supply current (per bank) 5 ma i ccj v ccj power supply current 8 14 ma 1. for further information on s upply current, please see tn1139, power estimation and management for latticexp2 devices . 2. assumes all outputs are tristated, all input s are configured as lvcmos and held at the v ccio or gnd. 3. frequency 0 mhz (excludes dynamic power from fpga operation). 4. a specific configuration pattern is used t hat scales with the size of the device; c onsists of 75% pfu utilization, 50% ebr, a nd 25% i/o con- figuration. 5. bypass or decoupling c apacitor across the supply. 6. t j = 25c, power supplies at nominal voltage. 7. in fpbga and ftbga packages the plls are connected to and powe red from the auxiliary power supply. for these packages, the ac tual auxiliary supply current is the sum of i ccaux and i ccpll . for csbga, pqfp and tqfp packages the plls are powered independent of the auxiliary power supply. 8. when programming via jtag.
3-6 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet sysio recommended operating conditions over recommended operating conditions standard v ccio v ref (v) min. typ. max. min. typ. max. lv c m o s 3 3 2 3.135 3.3 3.465 ? ? ? lv c m o s 2 5 2 2.375 2.5 2.625 ? ? ? lvcmos18 1.71 1.8 1.89 ? ? ? lvcmos15 1.425 1.5 1.575 ? ? ? lv c m o s 1 2 2 1.14 1.2 1.26 ? ? ? lv t t l 3 3 2 3.135 3.3 3.465 ? ? ? pci33 3.135 3.3 3.465 ? ? ? sstl18_i 2 , sstl18_ii 2 1.71 1.8 1.89 0.833 0.9 0.969 sstl25_i 2 , sstl25_ii 2 2.375 2.5 2.625 1.15 1.25 1.35 sstl33_i 2 , sstl33_ii 2 3.135 3.3 3.465 1.3 1.5 1.7 hstl15_i 2 1.425 1.5 1.575 0.68 0.75 0.9 hstl18_i 2 , hstl18_ii 2 1.71 1.8 1.89 0.816 0.9 1.08 lv d s 2 5 2 2.375 2.5 2.625 ? ? ? mlvds25 1 2.375 2.5 2.625 ? ? ? lvpecl33 1, 2 3.135 3.3 3.465 ? ? ? blvds25 1, 2 2.375 2.5 2.625 ? ? ? rsds 1, 2 2.375 2.5 2.625 ? ? ? sstl18d_i 2 , sstl18d_ii 2 1.71 1.8 1.89 ? ? ? sstl25d_ i 2 , sstl25d_ii 2 2.375 2.5 2.625 ? ? ? sstl33d_ i 2 , sstl33d_ ii 2 3.135 3.3 3.465 ? ? ? hstl15d_ i 2 1.425 1.5 1.575 ? ? ? hstl18d_ i 2 , hstl18d_ ii 2 1.71 1.8 1.89 ? ? ? 1. inputs on chip. outputs are implemented with the addition of external resistors. 2. input on this standard does not depend on the value of v ccio .
3-7 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet sysio single-ended dc el ectrical characteristics over recommended operating conditions input/output standard v il v ih v ol v oh i ol 1 (ma) i oh 1 (ma) min. (v) max. (v) min. (v) max. (v) max. (v) min. (v) lvcmos33 -0.3 0.8 2.0 3.6 0.4 v ccio - 0.4 20, 16, 12, 8, 4 -20, -16, -12, -8, -4 0.2 v ccio - 0.2 0.1 -0.1 lvttl33 -0.3 0.8 2.0 3.6 0.4 v ccio - 0.4 20, 16, 12, 8, 4 -20, -16, -12, -8, -4 0.2 v ccio - 0.2 0.1 -0.1 lvcmos25 -0.3 0.7 1.7 3.6 0.4 v ccio - 0.4 20, 16, 12, 8, 4 -20, -16, -12, -8, -4 0.2 v ccio - 0.2 0.1 -0.1 lvcmos18 -0.3 0.35 v ccio 0.65 v ccio 3.6 0.4 v ccio - 0.4 16, 12, 8, 4 -16, -12, -8, -4 0.2 v ccio - 0.2 0.1 -0.1 lvcmos15 -0.3 0.35 v ccio 0.65 v ccio 3.6 0.4 v ccio - 0.4 8, 4 -8, -4 0.2 v ccio - 0.2 0.1 -0.1 lvcmos12 -0.3 0.35 v cc 0.65 v cc 3.6 0.4 v ccio - 0.4 6, 2 -6, -2 0.2 v ccio - 0.2 0.1 -0.1 pci33 -0.3 0.3 v ccio 0.5 v ccio 3.6 0.1 v ccio 0.9 v ccio 1.5 -0.5 sstl33_i -0.3 v ref - 0.2 v ref + 0.2 3.6 0.7 v ccio - 1.1 8 -8 sstl33_ii -0.3 v ref - 0.2 v ref + 0.2 3.6 0.5 v ccio - 0.9 16 -16 sstl25_i -0.3 v ref - 0.18 v ref + 0.18 3.6 0.54 v ccio - 0.62 7.6 -7.6 12 -12 sstl25_ii -0.3 v ref - 0.18 v ref + 0.18 3.6 0.35 v ccio - 0.43 15.2 -15.2 20 -20 sstl18_i -0.3 v ref - 0.125 v ref + 0.125 3.6 0.4 v ccio - 0.4 6.7 -6.7 sstl18_ii -0.3 v ref - 0.125 v ref + 0.125 3.6 0.28 v ccio - 0.28 8-8 11 -11 hstl15_i -0.3 v ref - 0.1 v ref + 0.1 3.6 0.4 v ccio - 0.4 4-4 8-8 hstl18_i -0.3 v ref - 0.1 v ref + 0.1 3.6 0.4 v ccio - 0.4 8-8 12 -12 hstl18_ii -0.3 v ref - 0.1 v ref + 0.1 3.6 0.4 v ccio - 0.4 16 -16 1. the average dc current drawn by i/os between gnd connections, or between the last gnd in an i/o bank and the end of an i/o ba nk, as shown in the logic signal connections table shall not exceed n * 8ma, where n is the number of i/os between bank gnd connection s or between the last gnd in a bank and the end of a bank.
3-8 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet sysio differential elec trical characteristics lv d s over recommended operating conditions differential hstl and sstl differential hstl and sstl outputs are implemented as a pair of complementary single-ended outputs. all allow- able single-ended output cl asses (class i and class ii) are supported in this mode. for further information on lvpecl, rsds, mlvds, blvds and other differential interfaces please see details in additional technical notes listed at the end of this data sheet. lvds25e the top and bottom sides of latticexp2 devices support lvds outputs via emulated complementary lvcmos out- puts in conjunction with a parallel resistor across the driver outputs. the scheme shown in figure 3-1 is one possi- ble solution for point-to-point signals. figure 3-1. lvds25e output termination example parameter description test conditions min. typ. max. units v inp , v inm input voltage 0 ? 2.4 v v cm input common mode voltage half the sum of the two inputs 0.05 ? 2.35 v v thd differential input threshold differ ence between the two inputs +/-100 ? ? mv i in input current power on or power off ? ? +/-10 a v oh output high voltage for v op or v om r t = 100 ohm ? 1.38 1.60 v v ol output low voltage for v op or v om r t = 100 ohm 0.9v 1.03 ? v v od output voltage differential (v op - v om ), r t = 100 ohm 250 350 450 mv ? v od change in v od between high and low ??50mv v os output voltage offset (v op + v om )/2, r t = 100 ohm 1.125 1.20 1.375 v ? v os change in v os between h and l ? ? 50 mv i sa output short circuit current v od = 0v driver outputs shorted to ground ??24ma i sab output short circuit current v od = 0v driver outputs shorted to each other ??12ma + - rs=158 ohms (1%) rs=158 ohms (1%) rp = 140 ohms (1%) rt = 100 ohms (1%) off-chip transmission line, zo = 100 ohm differential vccio = 2.5v (5%) 8 ma vccio = 2.5v (5%) on-chip off-chip on-chip 8 ma
3-9 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet table 3-1. lvds25e dc conditions lvcmos33d all i/o banks support emulated differential i/o using the lvcmos33d i/o type. this option, along with the external resistor network, provides the system designer the flexibility to place differential outputs on an i/o bank with 3.3v vccio. the default drive current for lvcmos33d output is 12ma with the option to change the device strength to 4ma, 8ma, 16ma or 20ma. follow the lvcmos33 specifications for the dc characteristics of the lvcmos33d. parameter description typical units v ccio output driver supply (+/-5%) 2.50 v z out driver impedance 20 ? r s driver series resistor (+/-1%) 158 ? r p driver parallel resistor (+/-1%) 140 ? r t receiver termination (+/-1%) 100 ? v oh output high voltage (after r p )1.43v v ol output low voltage (after r p )1.07v v od output differential voltage (after r p )0.35 v v cm output common mode voltage 1.25 v z back back impedance 100.5 ? i dc dc output current 6.03 ma
3-10 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet blvds the latticexp2 devices support the blvds standard. this standard is emulated using complementary lvcmos outputs in conjunction with a parallel external resistor across the driver outputs. blvds is intended for use when multi-drop and bi-directional multi-point differential signaling is required. the scheme shown in figure 3-2 is one possible solution for bi-directional multi-point differential signals. figure 3-2. blvds multi-point output example table 3-2. blvds dc conditions 1 over recommended operating conditions parameter description typical units zo = 45 ? zo = 45 ? v ccio output driver supply (+/- 5%) 2.50 2.50 v z out driver impedance 10.00 10.00 ? r s driver series resistor (+/- 1%) 90.00 90.00 ? r tl driver parallel resistor (+/- 1%) 45.00 90.00 ? r tr receiver termination (+/- 1%) 45.00 90.00 ? v oh output high voltage (after r tl ) 1.38 1.48 v v ol output low voltage (after r tl ) 1.12 1.02 v v od output differentia l voltage (after r tl ) 0.25 0.46 v v cm output common mode voltage 1.25 1.25 v i dc dc output current 11.24 10.20 ma 1. for input buffer, see lvds table. heavily loaded backplane, effective zo ~ 45 to 90 ohms differential 2.5v r tl r tr r s = 90 ohms r s = 90 ohms r s = 90 ohms r s = 90 ohms r s = 90 ohms r s = 90 ohms r s = 90 ohms r s = 90 ohms 45-90 ohms 45-90 ohms 2.5v 2.5v 2.5v 2.5v 2.5v 2.5v 2.5v + - . . . + - . . . + - + - 16ma 16ma 16ma 16ma 16ma 16ma 16ma 16ma
3-11 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet lvpecl the latticexp2 devices support the diff erential lvpecl standard. this standard is emulat ed using complementary lvcmos outputs in conjunct ion with a parallel resistor across the driv er outputs. the lvpecl input standard is supported by the lvds differential input buffer. the scheme shown in figure 3-3 is one possible solution for point- to-point signals. figure 3-3. diff erential lvpecl table 3-3. lvpecl dc conditions 1 over recommended operating conditions parameter description typical units v ccio output driver supply (+/-5%) 3.30 v z out driver impedance 10 ? r s driver series resistor (+/-1%) 93 ? r p driver parallel resistor (+/-1%) 196 ? r t receiver termination (+/-1%) 100 ? v oh output high voltage (after r p )2.05v v ol output low voltage (after r p )1.25v v od output differential voltage (after r p )0.80 v v cm output common mode voltage 1.65 v z back back impedance 100.5 ? i dc dc output current 12.11 ma 1. for input buffer, see lvds table. transmission line, zo = 100 ohm differential off-chip on-chip v ccio = 3.3v (+/-5%) v ccio = 3.3v (+/-5%) r p = 196 ohms (+/-1%) r t = 100 ohms (+/-1%) r s = 93.1 ohms (+/-1%) r s = 93.1 ohms (+/-1%) 16ma 16ma + - off-chip on-chip
3-12 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet rsds the latticexp2 devices support differential rsds standard. this standard is emulated using complementary lvc- mos outputs in conjunction with a parallel resistor across the driver outputs. the rsds input standard is sup- ported by the lvds differential input buffer. the scheme shown in figure 3-4 is one possible solution for rsds standard implementation. resistor values in figure 3-4 are industry standard values for 1% resistors. figure 3-4. rsds (reduced swing differential standard) table 3-4. rsds dc conditions 1 over recommended operating conditions parameter description typical units v ccio output driver supply (+/-5%) 2.50 v z out driver impedance 20 ? r s driver series resistor (+/-1%) 294 ? r p driver parallel resistor (+/-1%) 121 ? r t receiver termination (+/-1%) 100 ? v oh output high voltage (after r p )1.35v v ol output low voltage (after r p )1.15v v od output differential voltage (after r p )0.20v v cm output common mode voltage 1.25 v z back back impedance 101.5 ? i dc dc output current 3.66 ma 1. for input buffer, see lvds table. r s = 294 ohms (+/-1%) r s = 294 ohms (+/-1%) r p = 121 ohms (+/-1%) r t = 100 ohms (+/-1%) on-chip on-chip 8ma 8ma v ccio = 2.5v (+/-5%) v ccio = 2.5v (+/-5%) transmission line, zo = 100 ohm differential + - off-chip off-chip
3-13 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet mlvds the latticexp2 devices support the differential mlvds standard. this standard is emulated using complementary lvcmos outputs in conjunction with a parallel resistor across the driver outputs. the mlvds input standard is supported by the lvds differential input buffer. the scheme shown in figure 3-5 is one possible solution for mlvds standard implementation. resistor values in figure 3-5 are industry standard values for 1% resistors. figure 3-5. mlvds (reduced swing differential standard) table 3-5. mlvds dc conditions 1 for further information on lvpecl, rsds, mlvds, blvds and other differential interfaces please see details of additional technical information at the end of this data sheet. parameter description typical units zo=50 ? zo=70 ? v ccio output driver supply (+/-5%) 2.50 2.50 v z out driver impedance 10.00 10.00 ? r s driver series resistor (+/-1%) 35.00 35.00 ? r tl driver parallel resistor (+/-1%) 50.00 70.00 ? r tr receiver termination (+/-1%) 50.00 70.00 ? v oh output high voltage (after r tl )1.521.60v v ol output low voltage (after r tl )0.980.90v v od output differential voltage (after r tl )0.54 0.70 v v cm output common mode voltage 1.25 1.25 v i dc dc output current 21.74 20.00 ma 1. for input buffer, see lvds table. 16ma 2.5v 2.5v + - 2.5v 2.5v + - 2.5v 2.5v + - . . . . . . a m 6 1 heavily loaded backplace, effective zo~50 to 70 ohms differential 50 to 70 ohms +/-1% 50 to 70 ohms +/-1% r s = 35ohms r s = 35ohms r s = 35ohms r s = 35ohms r s = 35ohms r s = 35ohms r s = 35ohms r s = 35ohms r tr r tl 16ma 2.5v a m 6 1 2.5v + - a m 6 1 2.5v a m 6 1 2.5v + - 16ma 16ma
3-14 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet typical building block function performance 1 pin-to-pin performance (lvcmos25 12ma drive) function -7 timing units basic functions 16-bit decoder 4.4 ns 32-bit decoder 5.2 ns 64-bit decoder 5.6 ns 4:1 mux 3.7 ns 8:1 mux 3.9 ns 16:1 mux 4.3 ns 32:1 mux 4.5 ns register-to-register performance function -7 timing units basic functions 16-bit decoder 521 mhz 32-bit decoder 537 mhz 64-bit decoder 484 mhz 4:1 mux 744 mhz 8:1 mux 678 mhz 16:1 mux 616 mhz 32:1 mux 529 mhz 8-bit adder 570 mhz 16-bit adder 507 mhz 64-bit adder 293 mhz 16-bit counter 541 mhz 32-bit counter 440 mhz 64-bit counter 321 mhz 64-bit accumulator 261 mhz embedded memory functions 512x36 single port ram, eb r output registers 315 mhz 1024x18 true-dual port ram (write through or normal, ebr output registers) 315 mhz 1024x18 true-dual port ram (write through or normal, plc output registers) 231 mhz distributed memory functions 16x4 pseudo-dual port ram (one pfu) 760 mhz 32x2 pseudo-dual port ram 455 mhz 64x1 pseudo-dual port ram 351 mhz dsp functions 18x18 multiplier (all registers) 342 mhz 9x9 multiplier (all registers) 342 mhz 36x36 multiply (all registers) 330 mhz 18x18 multiply/accumulate (input and output registers) 218 mhz 18x18 multiply-add/sub-sum (all registers) 292 mhz
3-15 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet derating timing tables logic timing provided in the following sections of this data sheet and the isplever design tools are worst case numbers in the operating range. actual delays at nominal temperature and voltage for best case process, can be much better than the values given in the tables. the isplever design tool can provide logic timing numbers at a particular temperature and voltage. dsp ip functions 16-tap fully-parallel fir filter 198 mhz 1024-pt fft 221 mhz 8x8 matrix multiplication 196 mhz 1. these timing numbers were generated using the isplever design to ol. exact performance may vary wi th device, design and tool v ersion. the tool uses internal parameters that have been characterized but are not tested on every device. timing v. a 0.12 register-to-register performance (continued) function -7 timing units
3-16 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet latticexp2 external sw itching characteristics over recommended operating conditions parameter description device -7 -6 -5 units min. max. min. max. min. max. general i/o pin parameters (using primary clock without pll) 1 t co clock to output - pio output register xp2-5 ? 3.80 ? 4.20 ? 4.60 ns xp2-8 ? 3.80 ? 4.20 ? 4.60 ns xp2-17 ? 3.80 ? 4.20 ? 4.60 ns xp2-30 ? 4.00 ? 4.40 ? 4.90 ns xp2-40 ? 4.00 ? 4.40 ? 4.90 ns t su clock to data setup - pio input register xp2-5 0.00 ? 0.00 ? 0.00 ? ns xp2-8 0.00 ? 0.00 ? 0.00 ? ns xp2-17 0.00 ? 0.00 ? 0.00 ? ns xp2-30 0.00 ? 0.00 ? 0.00 ? ns xp2-40 0.00 ? 0.00 ? 0.00 ? ns t h clock to data hold - pio input register xp2-5 1.40 ? 1.70 ? 1.90 ? ns xp2-8 1.40 ? 1.70 ? 1.90 ? ns xp2-17 1.40 ? 1.70 ? 1.90 ? ns xp2-30 1.40 ? 1.70 ? 1.90 ? ns xp2-40 1.40 ? 1.70 ? 1.90 ? ns t su_del clock to data setup - pio input register with data input delay xp2-5 1.40 ? 1.70 ? 1.90 ? ns xp2-8 1.40 ? 1.70 ? 1.90 ? ns xp2-17 1.40 ? 1.70 ? 1.90 ? ns xp2-30 1.40 ? 1.70 ? 1.90 ? ns xp2-40 1.40 ? 1.70 ? 1.90 ? ns t h_del clock to data hold - pio input register with input data delay xp2-5 0.00 ? 0.00 ? 0.00 ? ns xp2-8 0.00 ? 0.00 ? 0.00 ? ns xp2-17 0.00 ? 0.00 ? 0.00 ? ns xp2-30 0.00 ? 0.00 ? 0.00 ? ns xp2-40 0.00 ? 0.00 ? 0.00 ? ns f max_io clock frequency of i/o and pfu register xp2 ?420?357?311mhz general i/o pin parameters (using edge clock without pll) 1 t coe clock to output - pio output register xp2-5 ? 3.20 ? 3.60 ? 3.90 ns xp2-8 ? 3.20 ? 3.60 ? 3.90 ns xp2-17 ? 3.20 ? 3.60 ? 3.90 ns xp2-30 ? 3.20 ? 3.60 ? 3.90 ns xp2-40 ? 3.20 ? 3.60 ? 3.90 ns t sue clock to data setup - pio input register xp2-5 0.00 ? 0.00 ? 0.00 ? ns xp2-8 0.00 ? 0.00 ? 0.00 ? ns xp2-17 0.00 ? 0.00 ? 0.00 ? ns xp2-30 0.00 ? 0.00 ? 0.00 ? ns xp2-40 0.00 ? 0.00 ? 0.00 ? ns
3-17 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet t he clock to data hold - pio input register xp2-5 1.00 ? 1.30 ? 1.60 ? ns xp2-8 1.00 ? 1.30 ? 1.60 ? ns xp2-17 1.00 ? 1.30 ? 1.60 ? ns xp2-30 1.20 ? 1.60 ? 1.90 ? ns xp2-40 1.20 ? 1.60 ? 1.90 ? ns t su_dele clock to data setup - pio input register with data input delay xp2-5 1.00 ? 1.30 ? 1.60 ? ns xp2-8 1.00 ? 1.30 ? 1.60 ? ns xp2-17 1.00 ? 1.30 ? 1.60 ? ns xp2-30 1.20 ? 1.60 ? 1.90 ? ns xp2-40 1.20 ? 1.60 ? 1.90 ? ns t h_dele clock to data hold - pio input register with input data delay xp2-5 0.00 ? 0.00 ? 0.00 ? ns xp2-8 0.00 ? 0.00 ? 0.00 ? ns xp2-17 0.00 ? 0.00 ? 0.00 ? ns xp2-30 0.00 ? 0.00 ? 0.00 ? ns xp2-40 0.00 ? 0.00 ? 0.00 ? ns f max_ioe clock frequency of i/o and pfu register xp2 ?420?357?311mhz general i/o pin parameters (using primary clock with pll) 1 t copll clock to output - pio output register xp2-5 ? 3.00 ? 3.30 ? 3.70 ns xp2-8 ? 3.00 ? 3.30 ? 3.70 ns xp2-17 ? 3.00 ? 3.30 ? 3.70 ns xp2-30 ? 3.00 ? 3.30 ? 3.70 ns xp2-40 ? 3.00 ? 3.30 ? 3.70 ns t supll clock to data setup - pio input register xp2-5 1.00 ? 1.20 ? 1.40 ? ns xp2-8 1.00 ? 1.20 ? 1.40 ? ns xp2-17 1.00 ? 1.20 ? 1.40 ? ns xp2-30 1.00 ? 1.20 ? 1.40 ? ns xp2-40 1.00 ? 1.20 ? 1.40 ? ns t hpll clock to data hold - pio input register xp2-5 0.90 ? 1.10 ? 1.30 ? ns xp2-8 0.90 ? 1.10 ? 1.30 ? ns xp2-17 0.90 ? 1.10 ? 1.30 ? ns xp2-30 1.00 ? 1.20 ? 1.40 ? ns xp2-40 1.00 ? 1.20 ? 1.40 ? ns t su_delpll clock to data setup - pio input register with data input delay xp2-5 1.90 ? 2.10 ? 2.30 ? ns xp2-8 1.90 ? 2.10 ? 2.30 ? ns xp2-17 1.90 ? 2.10 ? 2.30 ? ns xp2-30 2.00 ? 2.20 ? 2.40 ? ns xp2-40 2.00 ? 2.20 ? 2.40 ? ns latticexp2 external switchin g characteristics (continued) over recommended operating conditions parameter description device -7 -6 -5 units min. max. min. max. min. max.
3-18 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet t h_delpll clock to data hold - pio input register with input data delay xp2-5 0.00 ? 0.00 ? 0.00 ? ns xp2-8 0.00 ? 0.00 ? 0.00 ? ns xp2-17 0.00 ? 0.00 ? 0.00 ? ns xp2-30 0.00 ? 0.00 ? 0.00 ? ns xp2-40 0.00 ? 0.00 ? 0.00 ? ns ddr 2 and ddr2 3 i/o pin parameters t dvadq data valid after dqs ? (ddr read) xp2 ? 0.29 ? 0.29 ? 0.29 ui t dvedq data hold after dqs ? (ddr read) xp2 0.71 ? 0.71 ? 0.71 ? ui t dqvbs data valid before dqs xp2 0.25 ? 0.25 ? 0.25 ? ui t dqvas data valid after dqs xp2 0.25 ? 0.25 ? 0.25 ? ui f max_ddr ddr clock frequency xp2 95 200 95 166 95 133 mhz f max_ddr2 ddr clock frequency xp2 133 200 133 200 133 166 mhz primary clock f max_pri frequency for primary clock tr e e xp2 ?420?357?311mhz t w_pri clock pulse width for primary clock xp2 1?1?1?ns t skew_pri primary clock skew within a bank xp2 ?160?160?160ps edge clock (eclk1 and eclk2) f max_eclk frequency for edge clock xp2 ? 420 ? 357 ? 311 mhz t w_eclk clock pulse width for edge clock xp2 1?1?1?ns t skew_eclk edge clock skew within an edge of the device xp2 ?130?130?130ps 1. general timing numbers based on lvcmos 2.5, 12ma, 0pf load. 2. ddr timing numbers based on sstl25. 3. ddr2 timing numbers based on sstl18. timing v. a 0.12 latticexp2 external switchin g characteristics (continued) over recommended operating conditions parameter description device -7 -6 -5 units min. max. min. max. min. max.
3-19 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet latticexp2 internal sw itching characteristics 1 over recommended operating conditions parameter description -7 -6 -5 units min. max. min. max. min. max. pfu/pff logic mode timing t lut4_pfu lut4 delay (a to d inputs to f o u t p u t ) ? 0.216 ? 0.238 ? 0.260 ns t lut6_pfu lut6 delay (a to d inputs to ofx output) ? 0.304 ? 0.399 ? 0.494 ns t lsr_pfu set/reset to output of pfu (asyn- chronous) ? 0.720 ? 0.769 ? 0.818 ns t sum_pfu clock to mux (m0,m1) input setup time 0.154 ? 0.151 ? 0.148 ? ns t hm_pfu clock to mux (m0,m1) input hold time -0.061 ? -0.057 ? -0.053 ? ns t sud_pfu clock to d input setup time 0.061 ? 0.077 ? 0.093 ? ns t hd_pfu clock to d input hold time 0.002 ? 0.003 ? 0.003 ? ns t ck2q_pfu clock to q delay, (d-type register configuration) ? 0.342 ? 0.363 ? 0.383 ns t rstrec_pfu asynchronous reset recovery time for pfu logic ? 0.520 ? 0.634 ? 0.748 ns t rst_pfu asynchronous reset time for pfu logic ? 0.720 ? 0.769 ? 0.818 ns pfu dual port memory mode timing t coram_pfu clock to output (f port) ? 1.082 ? 1.267 ? 1.452 ns t sudata_pfu data setup time -0.206 ? -0.240 ? -0.274 ? ns t hdata_pfu data hold time 0.239 ? 0.275 ? 0.312 ? ns t suaddr_pfu address setup time -0.294 ? -0.333 ? -0.371 ? ns t haddr_pfu address hold time 0.295 ? 0.333 ? 0.371 ? ns t suwren_pfu write/read enable setup time -0.146 ? -0.169 ? -0.193 ? ns t hwren_pfu write/read enable hold time 0.158 ? 0.182 ? 0.207 ? ns pio input/output buffer timing t in_pio input buffer delay (lvcmos25) ? 0.858 ? 0.766 ? 0.674 ns t out_pio output buffer delay (lvcmos25) ? 1.561 ? 1.403 ? 1.246 ns iologic input/output timing t sui_pio input register setup time (data before clock) 0.583 ? 0.893 ? 1.201 ? ns t hi_pio input register hold time (data after clock) 0.062 ? 0.322 ? 0.482 ? ns t coo_pio output register clock to output delay ? 0.608 ? 0.661 ? 0.715 ns t suce_pio input register clock enable setup time 0.032 ? 0.037 ? 0.041 ? ns t hce_pio input register clock enable hold time -0.022 ? -0.025 ? -0.028 ? ns t sulsr_pio set/reset setup time 0.184 ? 0.201 ? 0.217 ? ns t hlsr_pio set/reset hold time -0.080 ? -0.086 ? -0.093 ? ns t rstrec_pio asynchronous reset recovery time for io logic 0.228 ? 0.247 ? 0.266 ? ns
3-20 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet t rst_pio asynchronous reset time for pfu logic ? 0.386 ? 0.419 ? 0.452 ns t del dynamic delay step size 0.035 0.035 0.035 0.035 0.035 0.035 ns ebr timing t co_ebr clock (read) to output from address or data ? 2.774 ? 3.142 ? 3.510 ns t coo_ebr clock (write) to output from ebr output register ? 0.360 ? 0.408 ? 0.456 ns t sudata_ebr setup data to ebr memory (write clk) -0.167 ? -0.198 ? -0.229 ? ns t hdata_ebr hold data to ebr memory (write clk) 0.194 ? 0.231 ? 0.267 ? ns t suaddr_ebr setup address to ebr memory (write clk) -0.117 ? -0.137 ? -0.157 ? ns t haddr_ebr hold address to ebr memory (write clk) 0.157 ? 0.182 ? 0.207 ? ns t suwren_ebr setup write/read enable to ebr memory (write/read clk) -0.135 ? -0.159 ? -0.182 ? ns t hwren_ebr hold write/read enable to ebr memory (write/read clk) 0.158 ? 0.186 ? 0.214 ? ns t suce_ebr clock enable setup time to ebr output register (read clk) 0.144 ? 0.160 ? 0.176 ? ns t hce_ebr clock enable hold time to ebr output register (read clk) -0.097 ? -0.113 ? -0.129 ? ns t rsto_ebr reset to output delay time from ebr output regi ster (asynchro- nous) ? 1.156 ? 1.341 ? 1.526 ns t sube_ebr byte enable set-up time to ebr output register -0.117 ? -0.137 ? -0.157 ? ns t hbe_ebr byte enable hold time to ebr output register dynamic delay on each pio 0.157 ? 0.182 ? 0.207 ? ns t rstrec_ebr asynchronous reset recovery time for ebr 0.233 ? 0.291 ? 0.347 ? ns t rst_ebr asynchronous reset time for ebr ? 1.156 ? 1.341 ? 1.526 ns pll parameters t rstkrec_pll after rstk de-assert, recovery time before next clock edge can toggle k-divider counter 1.000 ? 1.000 ? 1.000 ? ns t rstrec_pll after rst de-assert, recovery time before next clock edge can toggle m-divider counter (applies to m-divider portion of rst only 2 ) 1.000 ? 1.000 ? 1.000 ? ns dsp block timing t sui_dsp input register setup time 0.135 ? 0.151 ? 0.166 ? ns t hi_dsp input register hold ti me 0.021 ? -0.006 ? -0.031 ? ns t sup_dsp pipeline register setup time 2.505 ? 2.784 ? 3.064 ? ns latticexp2 internal sw itching characteristics 1 (continued) over recommended operating conditions parameter description -7 -6 -5 units min. max. min. max. min. max.
3-21 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet t hp_dsp pipeline register hold time -0.787 ? -0.890 ? -0.994 ? ns t suo_dsp output register setup time 4.896 ? 5.413 ? 5.931 ? ns t ho_dsp output register hold ti me -1.439 ? -1.604 ? -1.770 ? ns t coi_dsp 3 input register clock to output time ? 4.513 ? 4.947 ? 5.382 ns t cop_dsp 3 pipeline register clock to output time ? 2.153 ? 2.272 ? 2.391 ns t coo_dsp 3 output register clock to output time ? 0.569 ? 0.600 ? 0.631 ns t suadsub adsub input register setup time -0.270 ? -0.298 ? -0.327 ? ns t hadsub adsub input register hold time 0.306 ? 0.338 ? 0.371 ? ns 1. internal parameters are characterized, but not tested on every device. 2. rst resets vco and all counters in pll. 3. these parameters include the adder subtractor block in the path. timing v. a 0.12 latticexp2 internal sw itching characteristics 1 (continued) over recommended operating conditions parameter description -7 -6 -5 units min. max. min. max. min. max.
3-22 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet ebr timing diagrams figure 3-6. read/write mode (normal) note: input data and address are registered at the positive edge of the clock and output data appears after the positive edge o f the clock. figure 3-7. read/write mode with input and output registers a0 a1 a0 a1 d0 d1 doa a0 t co_ebr t co_ebr invalid data t co_ebr t su t h d0 d1 d0 dia ada wea csa clka a0 a1 a0 a0 d0 d1 output is only updated during a read cycle a1 d0 d1 mem(n) data from previous read dia ada wea csa clka doa (regs) t su t h t coo_ebr t coo_ebr
3-23 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet figure 3-8. write through (sp read/write on port a, input registers only) note: input data and address are registered at the positive edge of the clock and output data appears after the positive edge o f the clock. a0 a1 a0 d0 d1 d4 t su t access t access t access t h d2 d3 d4 d0 d1 d2 data from prev read or write three consecutive writes to a0 d3 doa dia ada wea csa clka t access
3-24 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet latticexp2 family timing adders 1, 2, 3 over recommended operating conditions buffer type description -7 -6 -5 units input adjusters lvds25 lvds -0.26 -0.11 0.04 ns blvds25 blvds -0.26 -0.11 0.04 ns mlvds lvds -0.26 -0.11 0.04 ns rsds rsds -0.26 -0.11 0.04 ns lvpecl33 lvpecl -0.26 -0.11 0.04 ns hstl18_i hstl_18 class i -0.23 -0.08 0.07 ns hstl18_ii hstl_18 class ii -0.23 -0.08 0.07 ns hstl18d_i differential hstl 18 class i -0.28 -0.13 0.02 ns hstl18d_ii differential hstl 18 class ii -0.28 -0.13 0.02 ns hstl15_i hstl_15 class i -0.23 -0.09 0.06 ns hstl15d_i differential hstl 15 class i -0.28 -0.13 0.01 ns sstl33_i sstl_3 class i -0.20 -0.04 0.12 ns sstl33_ii sstl_3 class ii -0.20 -0.04 0.12 ns sstl33d_i differential sstl_3 class i -0.27 -0.11 0.04 ns sstl33d_ii differential sstl_3 class ii -0.27 -0.11 0.04 ns sstl25_i sstl_2 class i -0.21 -0.06 0.10 ns sstl25_ii sstl_2 class ii -0.21 -0.06 0.10 ns sstl25d_i differential sstl_2 class i -0.27 -0.12 0.03 ns sstl25d_ii differential sstl_2 class ii -0.27 -0.12 0.03 ns sstl18_i sstl_18 class i -0.23 -0.08 0.07 ns sstl18_ii sstl_18 class ii -0.23 -0.08 0.07 ns sstl18d_i differential sstl_18 class i -0.28 -0.13 0.02 ns sstl18d_ii differential sstl_18 class ii -0.28 -0.13 0.02 ns lvttl33 lvttl -0.09 0.05 0.18 ns lvcmos33 lvcmos 3.3 -0.09 0.05 0.18 ns lvcmos25 lvcmos 2.5 0.00 0.00 0.00 ns lvcmos18 lvcmos 1.8 -0.23 -0.07 0.09 ns lvcmos15 lvcmos 1.5 -0.20 -0.02 0.16 ns lvcmos12 lvcmos 1.2 -0.35 -0.20 -0.04 ns pci33 3.3v pci -0.09 0.05 0.18 ns output adjusters lv d s 2 5 e lv d s 2 . 5 e 4 -0.25 0.02 0.30 ns lvds25 lvds 2.5 -0.25 0.02 0.30 ns blvds25 blvds 2.5 -0.28 0.00 0.28 ns mlvds mlvds 2.5 4 -0.28 0.00 0.28 ns rsds rsds 2.5 4 -0.25 0.02 0.30 ns lvpecl33 lvpecl 3.3 4 -0.37 -0.10 0.18 ns hstl18_i hstl_18 class i 8ma drive -0.17 0.13 0.43 ns hstl18_ii hstl_18 class ii -0.29 0.00 0.29 ns hstl18d_i differential hstl 18 class i 8ma drive -0.17 0.13 0.43 ns hstl18d_ii differential hstl 18 class ii -0.29 0.00 0.29 ns
3-25 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet hstl15_i hstl_15 class i 4ma drive 0.32 0.69 1.06 ns hstl15d_i differential hstl 15 class i 4ma drive 0.32 0.69 1.06 ns sstl33_i sstl_3 class i -0.25 0.05 0.35 ns sstl33_ii sstl_3 class ii -0.31 -0.02 0.27 ns sstl33d_i differential sstl_3 class i -0.25 0.05 0.35 ns sstl33d_ii differential sstl_3 class ii -0.31 -0.02 0.27 ns sstl25_i sstl_2 class i 8ma drive -0.25 0.02 0.30 ns sstl25_ii sstl_2 class ii 16ma drive -0.28 0.00 0.28 ns sstl25d_i differential sstl_2 class i 8ma drive -0.25 0.02 0.30 ns sstl25d_ii differential sstl_2 class ii 16ma drive -0.28 0.00 0.28 ns sstl18_i sstl_1.8 class i -0.17 0.13 0.43 ns sstl18_ii sstl_1.8 class ii 8ma drive -0.18 0.12 0.42 ns sstl18d_i differential sstl_1.8 class i -0.17 0.13 0.43 ns sstl18d_ii differential sstl_1.8 class ii 8ma drive -0.18 0.12 0.42 ns lvttl33_4ma lvttl 4ma drive -0.37 -0.05 0.26 ns lvttl33_8ma lvttl 8ma drive -0.45 -0.18 0.10 ns lvttl33_12ma lvttl 12ma drive -0.52 -0.24 0.04 ns lvttl33_16ma lvttl 16ma drive -0.43 -0.14 0.14 ns lvttl33_20ma lvttl 20ma drive -0.46 -0.18 0.09 ns lvcmos33_4ma lvcmos 3.3 4ma drive, fast slew rate -0.37 -0.05 0.26 ns lvcmos33_8ma lvcmos 3.3 8ma drive, fast slew rate -0.45 -0.18 0.10 ns lvcmos33_12ma lvcmos 3.3 12ma drive, fast slew rate -0.52 -0.24 0.04 ns lvcmos33_16ma lvcmos 3.3 16ma drive, fast slew rate -0.43 -0.14 0.14 ns lvcmos33_20ma lvcmos 3.3 20ma drive, fast slew rate -0.46 -0.18 0.09 ns lvcmos25_4ma lvcmos 2.5 4ma drive, fast slew rate -0.42 -0.15 0.13 ns lvcmos25_8ma lvcmos 2.5 8ma drive, fast slew rate -0.48 -0.21 0.05 ns lvcmos25_12ma lvcmos 2.5 12ma drive, fast slew rate 0.00 0.00 0.00 ns lvcmos25_16ma lvcmos 2.5 16ma drive, fast slew rate -0.45 -0.18 0.08 ns lvcmos25_20ma lvcmos 2.5 20ma drive, fast slew rate -0.49 -0.22 0.04 ns lvcmos18_4ma lvcmos 1.8 4ma drive, fast slew rate -0.46 -0.18 0.10 ns lvcmos18_8ma lvcmos 1.8 8ma drive, fast slew rate -0.52 -0.25 0.02 ns lvcmos18_12ma lvcmos 1.8 12ma drive, fast slew rate -0.56 -0.30 -0.03 ns lvcmos18_16ma lvcmos 1.8 16ma drive, fast slew rate -0.50 -0.24 0.03 ns lvcmos15_4ma lvcmos 1.5 4ma drive, fast slew rate -0.45 -0.17 0.11 ns lvcmos15_8ma lvcmos 1.5 8ma drive, fast slew rate -0.53 -0.26 0.00 ns lvcmos12_2ma lvcmos 1.2 2ma drive, fast slew rate -0.46 -0.19 0.08 ns lvcmos12_6ma lvcmos 1.2 6ma drive, fast slew rate -0.55 -0.29 -0.02 ns lvcmos33_4ma lvcmos 3.3 4ma drive, slow slew rate 0.98 1.41 1.84 ns lvcmos33_8ma lvcmos 3.3 8ma drive, slow slew rate 0.74 1.16 1.58 ns lvcmos33_12ma lvcmos 3.3 12ma drive, slow slew rate 0.56 0.97 1.38 ns lvcmos33_16ma lvcmos 3.3 16ma drive, slow slew rate 0.77 1.19 1.61 ns lvcmos33_20ma lvcmos 3.3 20ma drive, slow slew rate 0.57 0.98 1.40 ns latticexp2 family timing adders 1, 2, 3 (continued) over recommended operating conditions buffer type description -7 -6 -5 units
3-26 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet lvcmos25_4ma lvcmos 2.5 4ma drive, slow slew rate 1.05 1.43 1.81 ns lvcmos25_8ma lvcmos 2.5 8ma drive, slow slew rate 0.78 1.15 1.52 ns lvcmos25_12ma lvcmos 2.5 12ma drive, slow slew rate 0.59 0.96 1.33 ns lvcmos25_16ma lvcmos 2.5 16ma drive, slow slew rate 0.81 1.18 1.55 ns lvcmos25_20ma lvcmos 2.5 20ma drive, slow slew rate 0.61 0.98 1.35 ns lvcmos18_4ma lvcmos 1.8 4ma drive, slow slew rate 1.01 1.38 1.75 ns lvcmos18_8ma lvcmos 1.8 8ma drive, slow slew rate 0.72 1.08 1.45 ns lvcmos18_12ma lvcmos 1.8 12ma drive, slow slew rate 0.53 0.90 1.26 ns lvcmos18_16ma lvcmos 1.8 16ma drive, slow slew rate 0.74 1.11 1.48 ns lvcmos15_4ma lvcmos 1.5 4ma drive, slow slew rate 0.96 1.33 1.71 ns lvcmos15_8ma lvcmos 1.5 8ma drive, slow slew rate -0.53 -0.26 0.00 ns lvcmos12_2ma lvcmos 1.2 2ma drive, slow slew rate 0.90 1.27 1.65 ns lvcmos12_6ma lvcmos 1.2 6ma drive, slow slew rate -0.55 -0.29 -0.02 ns pci33 3.3v pci -0.29 -0.01 0.26 ns 1. timing adders are characterized but not tested on every device. 2. lvcmos timing measured with the load s pecified in switching test condition table. 3. all other standards tested according to the appropriate specifications. 4. these timing adders are measured with the recommended resistor values. timing v. a 0.12 latticexp2 family timing adders 1, 2, 3 (continued) over recommended operating conditions buffer type description -7 -6 -5 units
3-27 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet sysclock pll timing over recommended operating conditions parameter description conditions min. typ. max. units f in input clock frequency (clki, clkfb) 10 ? 435 mhz f out output clock frequency (clkop, clkos) 10 ? 435 mhz f out2 k-divider output frequency clkok 0.078 ? 217.5 mhz clkok2 3.3 ? 145 mhz f vco pll vco frequency 435 ? 870 mhz f pfd phase detector input frequency 10 ? 435 mhz ac characteristics t dt output clock duty cycle def ault duty cycle selected 3 45 50 55 % t cpa coarse phase adjust -5 0 5 % t ph 4 output phase accuracy -5 0 5 % t opjit 1 output clock period jitter f out > 400 mhz ? ? 50 ps 100 mhz < f out < 400 mhz ? ? 125 ps f out < 100 mhz ? ? 0.025 uipp t sk input clock to output clock skew n/m = integer ? ? 240 ps t opw output clock pulse width at 90% or 10% 1 ? ? ns t lock 2 pll lock-in time 25 to 435 mhz ? ? 50 s 10 to 25 mhz ? ? 100 s t ipjit input clock period jitter ? ? 200 ps t fbkdly external feedback delay ? ? 10 ns t hi input clock high time 90% to 90% 0.5 ? ? ns t lo input clock low time 10% to 10% 0.5 ? ? ns t r / t f input clock rise/fall time 10% to 90% ? ? 1 ns t rstkw reset signal pulse width (rstk) 10 ? ? ns t rstw reset signal pulse width (rst) 500 ? ? ns 1. jitter sample is taken over 10,000 samples of the primary pll output with clean reference clock. 2. output clock is valid after t lock for pll reset and dynamic delay adjustment. 3. using lvds output buffers. 4. relative to clkop. timing v. a 0.12
3-28 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet latticexp2 sysconfig port timing specifications over recommended operating conditions parameter description min max units sysconfig por, initialization and wake up t icfg minimum vcc to initn high ? 50 ms t vmc time from t icfg to valid master cclk ? 2 s t prgmrj programn pin pulse rejection ? 12 ns t prgm programn low time to start configuration 50 ? ns t dinit programn high to initn high delay ? 1 ms t dppinit delay time from programn low to initn low ? 50 ns t dppdone delay time from programn low to done low ? 50 ns t iodiss user i/o disable from programn low ? 35 ns t ioenss user i/o enabled time from ccl k edge during wake-up sequence ? 25 ns t mwc additional wake master clock signals after done pin high 0 ? cycles sysconfig spi port (master) t cfgx initn high to cclk low ? 1 s t csspi initn high to csspin low ? 2 s t cscclk cclk low before csspin low 0 ? ns t socdo cclk low to output valid ? 15 ns t cspid csspin[0:1] low to first cclk edge setup time 2cyc 600+6cyc ns f maxspi max cclk frequency ? 20 mhz t suspi sospi data setup time before cclk 7 ? ns t hspi sospi data hold ti me after cclk 10 ? ns sysconfig spi port (slave) f maxspis slave cclk frequency ? 25 mhz t rf rise and fall time 50 ? mv/ns t stco falling edge of cclk to sospi active ? 20 ns t stoz falling edge of cclk to sospi disable ? 20 ns t stsu data setup time (sispi) 8 ? ns t sth data hold time (sispi) 10 ? ns t stckh cclk clock pulse width, high 0.02 200 s t stckl cclk clock pulse width, low 0.02 200 s t stvo falling edge of cclk to valid sospi output ? 20 ns t scs csspisn high time 25 ? ns t scss csspisn setup time 25 ? ns t scsh csspisn hold time 25 ? ns
3-29 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet on-chip oscillator and configuratio n master clock characteristics over recommended operating conditions figure 3-9. master spi configuration waveforms parameter min. max. units master clock frequency selected value -30% selected value +30% mhz duty cycle 40 60 % timing v. a 0.12 opcode address 0 1 2 3 ? 7 8 9 10 ? 31 32 33 34 ? 127 128 vcc programn done initn csspin cclk sispi sospi capture cfgx capture cr0 ignore valid bitstream
3-30 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet flash download time (from on-chip flash to sram) over recommended operating conditions flash program time over recommended operating conditions flash erase time over recommended operating conditions symbol parameter min. typ. max. units t refresh programn low-to- high. transition to done high. xp2-5 ? 1.8 2.1 ms xp2-8 ? 1.9 2.3 ms xp2-17 ? 1.7 2.0 ms xp2-30 ? 2.0 2.1 ms xp2-40 ? 2.0 2.3 ms power-up refresh when programn is pulled up to v cc ? (v cc =v cc min) xp2-5 ? 1.8 2.1 ms xp2-8 ? 1.9 2.3 ms xp2-17 ? 1.7 2.0 ms xp2-30 ? 2.0 2.1 ms xp2-40 ? 2.0 2.3 ms device flash density program time units typ. xp2-5 1.2m tag 1 . 0 m s main array 1.1 s xp2-8 2.0m tag 1 . 0 m s main array 1.4 s xp2-17 3.6m tag 1 . 0 m s main array 1.8 s xp2-30 6.0m tag 2 . 0 m s main array 3.0 s xp2-40 8.0m tag 2 . 0 m s main array 4.0 s device flash density erase time units typ. xp2-5 1.2m tag 1 . 0 s main array 3.0 s xp2-8 2.0m tag 1 . 0 s main array 4.0 s xp2-17 3.6m tag 1 . 0 s main array 5.0 s xp2-30 6.0m tag 2 . 0 s main array 7.0 s xp2-40 8.0m tag 2 . 0 s main array 9.0 s
3-31 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet flashbak time (from ebr to flash) over recommended operating conditions jtag port timing specifications over recommended operating conditions device ebr density (bits) time (typ.) units xp2-5 166k 1.5 s xp2-8 221k 1.5 s xp2-17 276k 1.5 s xp2-30 387k 2.0 s xp2-40 885k 3.0 s symbol parameter min. max. units f max tck clock frequency ? 25 mhz t btcp tck [bscan] clock pulse width 40 ? ns t btcph tck [bscan] clock pulse width high 20 ? ns t btcpl tck [bscan] clock pulse width low 20 ? ns t bts tck [bscan] setup time 8 ? ns t bth tck [bscan] hold time 10 ? ns t btrf tck [bscan] rise/fall time 50 ? mv/ns t btco tap controller falling edge of clock to valid output ? 10 ns t btcodis tap controller falling edge of clock to valid disable ? 10 ns t btcoen tap controller falling edge of clock to valid enable ? 10 ns t btcrs bscan test capture register setup time 8 ? ns t btcrh bscan test capture register hold time 25 ? ns t butco bscan test update register, falling edge of clock to valid output ? 25 ns t btuodis bscan test update register, falling edge of clock to valid disable ? 25 ns t btupoen bscan test update register, falling edge of clock to valid enable ? 25 ns timing v. a 0.12
3-32 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet figure 3-10. jtag port timing waveforms tms tdi tck tdo data to be captured from i/o data to be driven out to i/o a t a d d i l a v a t a d d i l a v a t a d d i l a v a t a d d i l a v data captured t btcph t btcpl t btcoen t btcrs t btupoen t butco t btuodis t btcrh t btco t btcodis t bts t bth t btcp
3-33 dc and switching characteristics lattice semiconductor lattice xp2 family data sheet switching test conditions figure 3-11 shows the output test load that is used for ac testing. the specific values for resistance, capacitance, voltage, and other test conditions are shown in table 3-6. figure 3-11. output test load, lvttl and lvcmos standards table 3-6. test fixture required components, non-terminated interfaces test condition r 1 r 2 c l timing ref. v t lvttl and other lvcmos settings (l -> h, h -> l) ?? 0pf lvcmos 3.3 = 1.5v ? lvcmos 2.5 = v ccio /2 ? lvcmos 1.8 = v ccio /2 ? lvcmos 1.5 = v ccio /2 ? lvcmos 1.2 = v ccio /2 ? lvcmos 2.5 i/o (z -> h) ? 1m ? v ccio /2 ? lvcmos 2.5 i/o (z -> l) 1m ? ? v ccio /2 v ccio lvcmos 2.5 i/o (h -> z) ? 100 v oh - 0.10 ? lvcmos 2.5 i/o (l -> z) 100 ? v ol + 0.10 v ccio note: output test conditions for all other inte rfaces are determined by the respective standards. dut v t r1 r2 cl* test poi nt *cl includes test fixture and probe capacitance
www.latticesemi.com 4-1 pinout information_01.5 june 2008 data sheet ds1009 ? 2008 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. signal descriptions signal name i/o description general purpose p[edge] [row/column number*]_[a/b] i/o [edge] indicates the edge of the device on which the pad is located. valid edge designations are l (left), b (bottom), r (right), t (top). [row/column number] indicates the pfu row or the column of the device on which the pic exists. when edge is t (top) or b (bottom), only need to spec- ify row number. when edge is l (left) or r (right), only need to specify col- umn number. [a/b] indicates the pio within the pic to which the pad is connected. some of these user-programmable pins are shared with special function pins. these pins, when not used as special purpose pins, can be programmed as i/os for user logic. during configuration the user-programmable i/os are tri-stated with an internal pull-up resistor enabl ed. if any pin is not used (or not bonded to a package pin), it is also tri-stat ed with an internal pull-up resistor enabled after configuration. gsrn i global reset signal (activ e low). any i/o pin can be gsrn. nc ? no connect. gnd ? ground. dedicated pins. v cc ? power supply pins for core logic. dedicated pins. v ccaux ? auxiliary power supply pin. this dedicated pin powers all the differential and referenced input buffers. v ccpll ? pll supply pins. csbga, pqfp and tqfp packages only. v cciox ? dedicated power supply pins for i/o bank x. v ref1_x , v ref2_x ? reference supply pins for i/o bank x. pre-determined pins in each bank are assigned as v ref inputs. when not used, they may be used as i/o pins. pll and clock functions (used as user programmable i/o pins when not in use for pll or clock pins) [loc][num]_v ccpll ? power supply pin for pll: llc, lrc, urc, ulc, num = row from center. [loc][num]_gpll[t, c]_in_a i general purpose pll (gpll) input pads: llc, lrc, urc, ulc, num = row from center, t = true and c = complement, index a,b,c...at each side. [loc][num]_gpll[t, c]_fb_a i optional feedback gpll input pads: llc, lrc, urc, ulc, num = row from center, t = true and c = complement, index a,b,c...at each side. pclk[t, c]_[n:0]_[3:0] i primary clock pads, t = true and c = complement, n per side, indexed by bank and 0,1,2,3 within bank. [loc]dqs[num] i dqs input pads: t (top), r (right), b (bottom), l (left), dqs, num = ball function number. any pad can be configured to be output. test and programmin g (dedicated pins) tms i test mode select input, used to control the 1149.1 state machine. pull-up is enabled during configuration. tck i test clock input pin, used to clock the 1149.1 state machine. no pull-up enabled. tdi i test data in pin. used to load data into device using 1149.1 state machine. after power-up, this tap port can be activated for configuration by sending appropriate command. (note: once a co nfiguration port is selected it is locked. another configuration port cannot be selected until the power-up sequence). pull-up is enabled during configuration. latticexp2 family data sheet pinout information
4-2 pinout information lattice semiconductor lattice xp2 family data sheet tdo o output pin. test data out pin used to shift data out of a device using 1149.1. vccj ? power supply pin for jtag test access port. configuration pads (used during sysconfig) cfg[1:0] i mode pins used to specify configuratio n mode values latched on rising edge of initn. during configuration, an internal pull-up is enabled. initn 1 i/o open drain pin. indicates the fpga is re ady to be configured. during config- uration, a pull-up is enabled. programn i initiates configuration sequence when asserted low. this pin always has an active pull-up. done i/o open drain pin. indicates that the c onfiguration sequence is complete, and the startup sequence is in progress. cclk i/o configuration clock for configuring an fpga in sysconfig mode. sispi 2 i/o input data pin in slave spi mode and output data pin in master spi mode. sospi 2 i/o output data pin in slave spi mode and input data pin in master spi mode. csspin 2 o chip select for external spi flash memory in master spi mode. this pin has a weak internal pull-up. csspisn i chip select in slave spi mode. this pin has a weak internal pull-up. toe i test output enable tristates all i/o pins when driven low. this pin has a weak internal pull-up, but when not used an external pull-up to v cc is recom- mended. 1. if not actively driven, the internal pull-up may not be su fficient. an external pull- up resistor of 4.7k to 10k ? is recommended. 2. when using the device in master spi mode, it must be mutually exclusive from jtag operations (i.e. tck tied to gnd) or the jt ag tck must be free-running when used in a system jtag test environment. if master spi mode is used in conjunction with a jtag downloa d cable, the device power cycle is required after the cable is unplugged. signal descriptions (cont.) signal name i/o description
4-3 pinout information lattice semiconductor lattice xp2 family data sheet pics and ddr data (dq) pins associ ated with the ddr strobe (dqs) pin pics associated with dqs strobe pio within pic ddr strobe (dqs) and data (dq) pins for left and right edges of the device p[edge] [n-4] adq bdq p[edge] [n-3] adq bdq p[edge] [n-2] adq bdq p[edge] [n-1] adq bdq p[edge] [n] a[edge]dqsn bdq p[edge] [n+1] adq bdq p[edge] [n+2] adq bdq p[edge] [n+3] adq bdq for top and bottom edges of the device p[edge] [n-4] adq bdq p[edge] [n-3] adq bdq p[edge] [n-2] adq bdq p[edge] [n-1] adq bdq p[edge] [n] a [edge]dqsn bdq p[edge] [n+1] adq bdq p[edge] [n+2] adq bdq p[edge] [n+3] adq bdq p[edge] [n+4] adq bdq notes: 1. ?n? is a row pic number. 2. the ddr interface is designed for memori es that support one dqs strobe up to 16 bits of data for the left and right edges and up to 18 bits of data for the top and bottom edges. in some packages, all the potential ddr data (dq) pins may not be available. pic numbering definitions are provided in the ?signal names? column of the signal descriptions table.
4-4 pinout information lattice semiconductor lattice xp2 family data sheet pin information summary pin type xp2-5 xp2-8 xp2-17 xp2-30 xp2-40 132 csbga 144 tqfp 208 pqfp 256 ftbga 132 csbga 144 tqfp 208 pqfp 256 ftbga 208 pqfp 256 ftbga 484 fpbga 256 ftbga 484 fpbga 672 fpbga 484 fpbga 672 fpbga single ended user i/o 86 100 146 172 86 100 146 201 146 201 358 201 363 472 363 540 differential pair user i/o normal 35 39 57 66 35 39 57 77 57 77 135 77 137 180 137 204 highspeed 8 11 16 20 8 11 16 23 16 23 44 23 44 56 44 66 configuration tap 5555555555555555 muxed 9999999999999999 dedicated1111111111111111 non configura- tion muxed 5 57 7 7 79 9111121 7 11131113 dedicated1111111111111111 vcc 6 49 6 6 49 6 9 6 16 6 16201620 vccaux 4444444444848888 vccpll 222-222-4------- vccio bank0 2222222222424444 bank1 1122112222424444 bank2 2222222222424444 bank3 1122112222424444 bank4 1122112222424444 bank5 2222222222424444 bank6 1122112222424444 bank7 2222222222424444 gnd, gnd0-gnd7 15 15 20 20 15 15 22 20 22 20 56 20 56 64 56 64 nc - -431- -22-2722692 1 single ended/ differential i/o per bank bank0 18/9 20/10 20/10 26/13 18/9 20/10 20/10 28/14 20/10 28/14 52/26 28/14 52/26 70/35 52/26 70/35 bank1 4/2 6/3 18/9 18/9 4/2 6/3 18/9 22/11 18/9 22/11 36/18 22/11 36/18 54/27 36/18 70/35 bank2 16/8 18/9 18/9 22/11 16/8 18/9 18/9 26/13 18/9 26/13 46/23 26/13 46/23 56/28 46/23 64/32 bank3 4/2 4/2 16/8 20/10 4/2 4/2 16/8 24/12 16/8 24/12 44/22 24/12 46/23 56/28 46/23 66/33 bank4 8/4 8/4 18/9 18/9 8/4 8/4 18/9 26/13 18/9 26/13 36/18 26/13 38/19 54/27 38/19 70/35 bank5 14/7 18/9 20/10 24/12 14/7 18/9 20/10 24/12 20/10 24/12 52/26 24/12 53/26 70/35 53/26 70/35 bank6 6/3 8/4 18/9 22/11 6/3 8/4 18/9 27/13 18/9 27/13 46/23 27/13 46/23 56/28 46/23 66/33 bank7 16/8 18/9 18/9 22/11 16/8 18/9 18/9 24/12 18/9 24/12 46/23 24/12 46/23 56/28 46/23 64/32 true lvds pairs ? bonding out per bank bank0 0000000000000000 bank1 0000000000000000 bank2 3 44 5 3 44 6 4 6 11 6 11141116 bank3 1 14 5 1 14 6 4 6 11 6 11141117 bank4 0000000000000000 bank5 0000000000000000 bank6 1 24 5 1 24 6 4 6 11 6 11141117 bank7 3 44 5 3 44 5 4 5 11 5 11141116 ddr banks bonding out per i/o bank 1 bank0 1111111111312424 bank1 0011001111212324 bank2 1111111111213334 bank3 0011001111213334 bank4 0011001111212324 bank5 1111111111312424 bank6 0011001111213334 bank7 1111111111213334
4-5 pinout information lattice semiconductor lattice xp2 family data sheet logic signal connections package pinout information can be found under ?data sheets? on the latticexp2 product page of the lattice web- site a www.latticesemi.com/products/fpga/xp2 and in the lattice isplever software. thermal management thermal management is recommended as part of any sound fpga design methodology. to assess the thermal characteristics of a system, lattice sp ecifies a maximum allowable junction temperature in all device data sheets. designers must complete a thermal analysis of their specific design to ensure that the device and package do not exceed the junction temperature limits. refer to the lattice thermal management document to find the device/ package specific thermal values. for further information ? tn1139, power estimation and management for latticexp2 devices ? power calculator tool included wit h lattice?s isplever design tool, or as a standalone download from ? www.latticesemi.com/products/designsoftware pci capable i/os ? bonding out per bank bank0 18202026182020282028522852705270 bank1 4 61818 4 618221822362236543670 bank2 0000000000000000 bank3 0000000000000000 bank4 8 81818 8 818261826362638543870 bank5 14182024141820242024522453705370 bank6 0000000000000000 bank7 0000000000000000 1. minimum requirement to implement a full y functional 8-bit wide ddr bus. available ddr interface consists of at least 12 i/os (1 dqs + 1 dqsb + 8 dqs + 1 dm + bank vref1). pin information summary (cont.) pin type xp2-5 xp2-8 xp2-17 xp2-30 xp2-40 132 csbga 144 tqfp 208 pqfp 256 ftbga 132 csbga 144 tqfp 208 pqfp 256 ftbga 208 pqfp 256 ftbga 484 fpbga 256 ftbga 484 fpbga 672 fpbga 484 fpbga 672 fpbga
www.latticesemi.com 5-1 order info_01.2 august 2008 data sheet ds1009 ? 2008 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. part number description lfxp2 ? xx e ? x xxxxx x grade c = commercial i = industrial logic capacity 5 = 5k luts 8 = 8k luts 17 = 17k luts 30 = 30k luts 40 = 40k luts supply voltage e = 1.2v speed 5 = slowest 6 7 = fastest package m132 = 132-ball csbga ft256 = 256-ball ftbga f484 = 484-ball fpbga f672 = 672-ball fpbga mn132 = 132-ball lead-free csbga tn144 = 144-pin lead-free tqfp qn208 = 208-pin lead-free pqfp ftn256 = 256-ball lead-free ftbga fn484 = 484-ball lead-free fpbga fn672 = 672-ball lead-free fpbga device family xp2 ordering information the latticexp2 devices are marked with a single temperat ure grade, either commercial or industrial, as shown below. lfxp2-17e 7ft256c datecode xp2 lfxp2-17e 6ft256i datecode xp2 latticexp2 family data sheet ordering information
5-2 ordering information lattice semiconductor lattice xp2 family data sheet lead-free packaging commercial part number voltage grade package pins temp. luts (k) lfxp2-5e-5mn132c 1.2v -5 lead-free csbga 132 com 5 lfxp2-5e-6mn132c 1.2v -6 lead-free csbga 132 com 5 lfxp2-5e-7mn132c 1.2v -7 lead-free csbga 132 com 5 lfxp2-5e-5tn144c 1.2v -5 lead-free tqfp 144 com 5 lfxp2-5e-6tn144c 1.2v -6 lead-free tqfp 144 com 5 lfxp2-5e-7tn144c 1.2v -7 lead-free tqfp 144 com 5 lfxp2-5e-5qn208c 1.2v -5 lead-free pqfp 208 com 5 lfxp2-5e-6qn208c 1.2v -6 lead-free pqfp 208 com 5 lfxp2-5e-7qn208c 1.2v -7 lead-free pqfp 208 com 5 lfxp2-5e-5ftn256c 1.2v -5 lead-free ftbga 256 com 5 lfxp2-5e-6ftn256c 1.2v -6 lead-free ftbga 256 com 5 lfxp2-5e-7ftn256c 1.2v -7 lead-free ftbga 256 com 5 part number voltage grade package pins temp. luts (k) lfxp2-8e-5mn132c 1.2v -5 lead-free csbga 132 com 8 lfxp2-8e-6mn132c 1.2v -6 lead-free csbga 132 com 8 lfxp2-8e-7mn132c 1.2v -7 lead-free csbga 132 com 8 lfxp2-8e-5tn144c 1.2v -5 lead-free tqfp 144 com 8 lfxp2-8e-6tn144c 1.2v -6 lead-free tqfp 144 com 8 lfxp2-8e-7tn144c 1.2v -7 lead-free tqfp 144 com 8 lfxp2-8e-5qn208c 1.2v -5 lead-free pqfp 208 com 8 lfxp2-8e-6qn208c 1.2v -6 lead-free pqfp 208 com 8 lfxp2-8e-7qn208c 1.2v -7 lead-free pqfp 208 com 8 lfxp2-8e-5ftn256c 1.2v -5 lead-free ftbga 256 com 8 lfxp2-8e-6ftn256c 1.2v -6 lead-free ftbga 256 com 8 lfxp2-8e-7ftn256c 1.2v -7 lead-free ftbga 256 com 8 part number voltage grade package pins temp. luts (k) lfxp2-17e-5qn208c 1.2v -5 lead-free pqfp 208 com 17 lfxp2-17e-6qn208c 1.2v -6 lead-free pqfp 208 com 17 lfxp2-17e-7qn208c 1.2v -7 lead-free pqfp 208 com 17 lfxp2-17e-5ftn256c 1.2v -5 lead-free ftbga 256 com 17 lfxp2-17e-6ftn256c 1.2v -6 lead-free ftbga 256 com 17 lfxp2-17e-7ftn256c 1.2v -7 lead-free ftbga 256 com 17 lfxp2-17e-5fn484c 1.2v -5 lead-free fpbga 484 com 17 lfxp2-17e-6fn484c 1.2v -6 lead-free fpbga 484 com 17 lfxp2-17e-7fn484c 1.2v -7 lead-free fpbga 484 com 17
5-3 ordering information lattice semiconductor lattice xp2 family data sheet industrial part number voltage grade package pins temp. luts (k) lfxp2-30e-5ftn256c 1.2v -5 lead-free ftbga 256 com 30 lfxp2-30e-6ftn256c 1.2v -6 lead-free ftbga 256 com 30 lfxp2-30e-7ftn256c 1.2v -7 lead-free ftbga 256 com 30 lfxp2-30e-5fn484c 1.2v -5 lead-free fpbga 484 com 30 lfxp2-30e-6fn484c 1.2v -6 lead-free fpbga 484 com 30 lfxp2-30e-7fn484c 1.2v -7 lead-free fpbga 484 com 30 lfxp2-30e-5fn672c 1.2v -5 lead-free fpbga 672 com 30 lfxp2-30e-6fn672c 1.2v -6 lead-free fpbga 672 com 30 lfxp2-30e-7fn672c 1.2v -7 lead-free fpbga 672 com 30 part number voltage grade package pins temp. luts (k) lfxp2-40e-5fn484c 1.2v -5 lead-free fpbga 484 com 40 lfxp2-40e-6fn484c 1.2v -6 lead-free fpbga 484 com 40 lfxp2-40e-7fn484c 1.2v -7 lead-free fpbga 484 com 40 lfxp2-40e-5fn672c 1.2v -5 lead-free fpbga 672 com 40 lfxp2-40e-6fn672c 1.2v -6 lead-free fpbga 672 com 40 lfxp2-40e-7fn672c 1.2v -7 lead-free fpbga 672 com 40 part number voltage grade package pins temp. luts (k) lfxp2-5e-5mn132i 1.2v -5 lead-free csbga 132 ind 5 lfxp2-5e-6mn132i 1.2v -6 lead-free csbga 132 ind 5 lfxp2-5e-5tn144i 1.2v -5 lead-free tqfp 144 ind 5 lfxp2-5e-6tn144i 1.2v -6 lead-free tqfp 144 ind 5 lfxp2-5e-5qn208i 1.2v -5 lead-free pqfp 208 ind 5 lfxp2-5e-6qn208i 1.2v -6 lead-free pqfp 208 ind 5 lfxp2-5e-5ftn256i 1.2v -5 lead-free ftbga 256 ind 5 lfxp2-5e-6ftn256i 1.2v -6 lead-free ftbga 256 ind 5 part number voltage grade package pins temp. luts (k) lfxp2-8e-5mn132i 1.2v -5 lead-free csbga 132 ind 8 lfxp2-8e-6mn132i 1.2v -6 lead-free csbga 132 ind 8 lfxp2-8e-5tn144i 1.2v -5 lead-free tqfp 144 ind 8 lfxp2-8e-6tn144i 1.2v -6 lead-free tqfp 144 ind 8 lfxp2-8e-5qn208i 1.2v -5 lead-free pqfp 208 ind 8 lfxp2-8e-6qn208i 1.2v -6 lead-free pqfp 208 ind 8 lfxp2-8e-5ftn256i 1.2v -5 lead-free ftbga 256 ind 8 lfxp2-8e-6ftn256i 1.2v -6 lead-free ftbga 256 ind 8
5-4 ordering information lattice semiconductor lattice xp2 family data sheet part number voltage grade package pins temp. luts (k) lfxp2-17e-5qn208i 1.2v -5 lead-free pqfp 208 ind 17 lfxp2-17e-6qn208i 1.2v -6 lead-free pqfp 208 ind 17 lfxp2-17e-5ftn256i 1.2v -5 lead-free ftbga 256 ind 17 lfxp2-17e-6ftn256i 1.2v -6 lead-free ftbga 256 ind 17 lfxp2-17e-5fn484i 1.2v -5 lead-free fpbga 484 ind 17 lfxp2-17e-6fn484i 1.2v -6 lead-free fpbga 484 ind 17 part number voltage grade package pins temp. luts (k) lfxp2-30e-5ftn256i 1.2v -5 lead-free ftbga 256 ind 30 lfxp2-30e-6ftn256i 1.2v -6 lead-free ftbga 256 ind 30 lfxp2-30e-5fn484i 1.2v -5 lead-free fpbga 484 ind 30 lfxp2-30e-6fn484i 1.2v -6 lead-free fpbga 484 ind 30 lfxp2-30e-5fn672i 1.2v -5 lead-free fpbga 672 ind 30 lfxp2-30e-6fn672i 1.2v -6 lead-free fpbga 672 ind 30 part number voltage grade package pins temp. luts (k) lfxp2-40e-5fn484i 1.2v -5 lead-free fpbga 484 ind 40 lfxp2-40e-6fn484i 1.2v -6 lead-free fpbga 484 ind 40 lfxp2-40e-5fn672i 1.2v -5 lead-free fpbga 672 ind 40 lfxp2-40e-6fn672i 1.2v -6 lead-free fpbga 672 ind 40
5-5 ordering information lattice semiconductor lattice xp2 family data sheet conventional packaging commercial part number voltage grade package pins temp. luts (k) lfxp2-5e-5m132c 1.2v -5 csbga 132 com 5 lfxp2-5e-6m132c 1.2v -6 csbga 132 com 5 lfxp2-5e-7m132c 1.2v -7 csbga 132 com 5 lfxp2-5e-5ft256c 1.2v -5 ftbga 256 com 5 lfxp2-5e-6ft256c 1.2v -6 ftbga 256 com 5 lfxp2-5e-7ft256c 1.2v -7 ftbga 256 com 5 part number voltage grade package pins temp. luts (k) lfxp2-8e-5m132c 1.2v -5 csbga 132 com 8 lfxp2-8e-6m132c 1.2v -6 csbga 132 com 8 lfxp2-8e-7m132c 1.2v -7 csbga 132 com 8 lfxp2-8e-5ft256c 1.2v -5 ftbga 256 com 8 lfxp2-8e-6ft256c 1.2v -6 ftbga 256 com 8 lfxp2-8e-7ft256c 1.2v -7 ftbga 256 com 8 part number voltage grade package pins temp. luts (k) lfxp2-17e-5ft256c 1.2v -5 ftbga 256 com 17 lfxp2-17e-6ft256c 1.2v -6 ftbga 256 com 17 lfxp2-17e-7ft256c 1.2v -7 ftbga 256 com 17 lfxp2-17e-5f484c 1.2v -5 fpbga 484 com 17 lfxp2-17e-6f484c 1.2v -6 fpbga 484 com 17 lfxp2-17e-7f484c 1.2v -7 fpbga 484 com 17 part number voltage grade package pins temp. luts (k) lfxp2-30e-5ft256c 1.2v -5 ftbga 256 com 30 lfxp2-30e-6ft256c 1.2v -6 ftbga 256 com 30 lfxp2-30e-7ft256c 1.2v -7 ftbga 256 com 30 lfxp2-30e-5f484c 1.2v -5 fpbga 484 com 30 lfxp2-30e-6f484c 1.2v -6 fpbga 484 com 30 lfxp2-30e-7f484c 1.2v -7 fpbga 484 com 30 lfxp2-30e-5f672c 1.2v -5 fpbga 672 com 30 lfxp2-30e-6f672c 1.2v -6 fpbga 672 com 30 lfxp2-30e-7f672c 1.2v -7 fpbga 672 com 30
5-6 ordering information lattice semiconductor lattice xp2 family data sheet industrial part number voltage grade package pins temp. luts (k) lfxp2-40e-5f484c 1.2v -5 fpbga 484 com 40 lfxp2-40e-6f484c 1.2v -6 fpbga 484 com 40 lfxp2-40e-7f484c 1.2v -7 fpbga 484 com 40 lfxp2-40e-5f672c 1.2v -5 fpbga 672 com 40 lfxp2-40e-6f672c 1.2v -6 fpbga 672 com 40 lfxp2-40e-7f672c 1.2v -7 fpbga 672 com 40 part number voltage grade package pins temp. luts (k) lfxp2-5e-5m132i 1.2v -5 csbga 132 ind 5 lfxp2-5e-6m132i 1.2v -6 csbga 132 ind 5 lfxp2-5e-6ft256i 1.2v -6 ftbga 256 ind 5 part number voltage grade package pins temp. luts (k) lfxp2-8e-5m132i 1.2v -5 csbga 132 ind 8 lfxp2-8e-6m132i 1.2v -6 csbga 132 ind 8 lfxp2-5e-5ft256i 1.2v -5 ftbga 256 ind 5 LFXP2-8E-5FT256I 1.2v -5 ftbga 256 ind 8 lfxp2-8e-6ft256i 1.2v -6 ftbga 256 ind 8 part number voltage grade package pins temp. luts (k) lfxp2-17e-5ft256i 1.2v -5 ftbga 256 ind 17 lfxp2-17e-6ft256i 1.2v -6 ftbga 256 ind 17 lfxp2-17e-5f484i 1.2v -5 fpbga 484 ind 17 lfxp2-17e-6f484i 1.2v -6 fpbga 484 ind 17 part number voltage grade package pins temp. luts (k) lfxp2-30e-5ft256i 1.2v -5 ftbga 256 ind 30 lfxp2-30e-6ft256i 1.2v -6 ftbga 256 ind 30 lfxp2-30e-5f484i 1.2v -5 fpbga 484 ind 30 lfxp2-30e-6f484i 1.2v -6 fpbga 484 ind 30 lfxp2-30e-5f672i 1.2v -5 fpbga 672 ind 30 lfxp2-30e-6f672i 1.2v -6 fpbga 672 ind 30
5-7 ordering information lattice semiconductor lattice xp2 family data sheet part number voltage grade package pins temp. luts (k) lfxp2-40e-5f484i 1.2v -5 fpbga 484 ind 40 lfxp2-40e-6f484i 1.2v -6 fpbga 484 ind 40 lfxp2-40e-5f672i 1.2v -5 fpbga 672 ind 40 lfxp2-40e-6f672i 1.2v -6 fpbga 672 ind 40
may 2007 data sheet ds1009 ? 2007 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. www.latticesemi.com 6-1 further info_01.1 for further information a variety of technical notes for the latticexp2 fpga family are available on the lattice semiconductor web site at ? www.latticesemi.com . ? tn1136, latticexp2 sysio usage guide ? tn1137, latticexp2 memory usage guide ? tn1138, latticexp2 high speed i/o interface ? tn1126, latticexp2 sysclock pll design and usage guide ? tn1139, power estimation and management for latticexp2 devices ? tn1140, latticexp2 sysdsp usage guide ? tn1141, latticexp2 sysconfig usage guide ? tn1142, latticexp2 configuration encryption and security usage guide ? tn1087, minimizing system interruption during configuration using transfr technology ? tn1144, latticexp2 dual boot usage guide ? tn1130, latticexp2 soft error detection (sed) usage guide ? tn1143, latticexp2 hardware checklist for further information on interface standards refer to the following websites: ? jedec standards (lvttl, lvcm os, sstl, hstl): www.jedec.org ? pci: www.pcisig.com latticexp2 family data sheet supplemental information
august 2008 data sheet ds1009 ? 2008 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. www.latticesemi.com 7-1 revision history date version section change summary may 2007 01.1 ? initial release. september 2007 01.2 dc and switching characteristics added jtag port timing waveforms diagram. updated sysclock pll timing table. pinout information added therma l management text section. february 2008 01.3 architecture added lvcmos33 d to supported output standards table. clarified: ?this flash can be programmed through either the jtag or slave spi ports of the device. the sram configuration space can also be infinitely reconfigured through the jtag and master spi ports.? added external slave spi port to serial tag memory section. updated serial tag memory diagram. dc and switching characteristics updated flash programming specifications table. added ?8w? specification to hot socketing specifications table. updated timing tables clarifications for iih in dc electrical characteristics table. added lvcmos33d section updated doa and doa (regs) to ebr timing diagrams. removed master clock frequency and duty cycle sections from the latticexp2 sysconfig port timing specificati ons table. these are listed on the on-chip oscillator and configuration master clock charac- teristics table. changed csspin to csspisn in description of t scs , t scss , and t scsh parameters. removed t soe parameter. clarified on-chip oscillator documentation added switching test conditions pinout information added ?true lvds pairs bonding out per bank,? ?ddr banks bonding out per i/o bank,? and ?pci capable i/os bonding out per bank? to pin information summary in place of previous blank table ?pci and ddr capabilities of the device-package combinations? removed pinout listing. this information is available on the latticexp2 product web pages ordering information added xp2-17 ?8w? and all other family opns. april 2008 01.4 dc and switching characteristics updated absolute maximum ratings footnotes. updated recommended operating conditions table footnotes. updated supply current (standby) table updated initialization supply current table updated programming and erase flash supply current table updated register to register performance table updated latticexp2 external switching characteristics table updated latticexp2 internal switching characteristics table updated sysclock pll timing table latticexp2 family data sheet revision history
7-2 revision history lattice semiconductor lattice xp2 family data sheet april 2008 (cont.) 01.4 (cont.) dc and switching characteristics (cont.) updated flash download time (from on-chip flash to sram) table updated flash program time table updated flash erase time table updated flashbak (from ebr to flash) table updated hot socketing spec ifications table footnotes pinout information updated signal descriptions table june 2008 01.5 architecture removed re ad-before-write sysmem ebr mode. clarification of the operation of the secondary clock regions. dc and switching characteristics removed read-before-write sysmem ebr mode. pinout information updated ddr banks bonding out per i/o bank section of pin informa- tion summary table. august 2008 01.6 ? data sheet status changed from preliminary to final. architecture clarification of the operation of the secondary clock regions. dc and switching characteristics removed ?8w? specification from hot socketing specifications table. removed "8w" footnote from dc electrical characteristics table. updated register-to-register performance table. ordering information removed ?8w? option from part number description. removed xp2-17 ?8w? opns. date version section change summary
section ii. latticexp2 fa mily technical notes
www.latticesemi.com 8-1 tn1136_01.2 february 2009 technical note tn1136 ? 2009 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. introduction the latticexp2? sysio? buffers give the designer the ability to easily interface with ot her devices using advanced system i/o standards. this technical note describes the sysio standards available and how they can be imple- mented using la ttice?s isplever ? design software. sysio buffer overview the latticexp2 sysio interface contains multiple programmable i/o cells (pic) blocks. each pic contains two pro- grammable i/os (pio), pioa and piob, connected to their respective sysio buffers. two adjacent pios can be joined to provide a differential i/o pair (labeled as ?t? and ?c?). each programmable i/o (pio) includes a sysio buffer and i/o logic (iologic). the latticexp2 sysio buffers supports a variety of single-ended and differential signaling standards. the sysio buffer also supports the dqs strobe signal that is required for interfacing with the ddr memory. one of every 16/18 pios in the latticexp2 con- tains a delay element to facilitate the generation of dqs signals. th e dqs signal from the bu s is used to strobe the ddr data from the memory into input register blocks. for more information on the architecture of the sysio buffer please refer to the latticexp2 family data sheet . the iologic includes input, output and tristate registers that implement both single data rate (sdr) and double data rate (ddr) applications along with the necessary clock and data selection logic. programmable delay lines and dedicated logic within the iologic are used to provide the required shift to incoming clock and data signals and the delay required by dqs inpu ts in ddr memory. the ddr implemen tation in the iologic and the ddr memory interface support are discussed in more detail in tn1138, latticexp2 high speed i/o interface . supported sysio standards the latticexp2 sysio buffer supports both single-ended and differential standards. single-ended standards can be further subdivided into internally ratioed standard such as lvcmos, lvttl and pci; and externally referenced standards such as hstl and sstl. the buffers support the lvttl, lvcmos 1.2, 1.5, 1.8, 2.5 and 3.3v stan- dards. in the lvcmos and lvttl modes, the buffer has individually configurable options for drive strength, bus maintenance (weak pull-up, weak pull-down, or a bus-keeper latch). other single-ended standards supported include sstl and hstl. differential st andards supported include mlvds, lvds, rsds, blvds, lvpecl, differ- ential sstl and differential hstl. tables 1 and 2 list the sysio standards supported in latticexp2 devices. table 8-1. supported input standards input standard v ref (nom.) v ccio 1 (nom.) single ended interfaces lv t t l ? ? lv c m o s 3 3 ? ? lv c m o s 2 5 ? ? lv c m o s 1 8 ? 1 . 8 lv c m o s 1 5 ? 1 . 5 lv c m o s 1 2 ? ? pci 33 ? 3.3 hstl18 class i, ii 0.9 ? hstl15 class i 0.75 ? sstl3 class i, ii 1.5 ? latticexp2 sysio usage guide
8-2 lattice semiconductor latt icexp2 sysio usage guide sstl2 class i, ii 1.25 ? sstl18 class i, ii 0.9 ? differential interfaces differential sstl18 class i, ii ? ? differential sstl2 class i, ii ? ? differential sstl3 class i, ii ? ? differential hstl15 class i ? ? differential hstl18 class i, ii ? ? lvds, mlvds, lvpecl, blvds, rsds ? ? 1 when not specified, v ccio can be set anywhere in the valid operating range. table 8-2. supported output standards output standard drive v ccio (nom.) single-ended interfaces lvttl 4ma, 8ma, 12ma, 16ma, 20ma 3.3 lvttl, open drain 4ma, 8ma, 12ma, 16ma, 20ma ? lvcmos33 4ma, 8ma, 12ma 16ma, 20ma 3.3 lvcmos25 4ma, 8ma, 12ma, 16ma, 20ma 2.5 lvcmos18 4ma, 8ma, 12ma, 16ma 1.8 lvcmos15 4ma, 8ma 1.5 lvcmos12 2ma, 6ma 1.2 lvcmos33, open drain 4ma, 8ma, 12ma 16ma, 20ma ? lvcmos25, open drain 4ma, 8ma, 12ma 16ma, 20ma ? lvcmos18, open drain 4ma, 8ma, 12ma 16ma ? lvcmos15, open drain 4ma, 8ma ? lvcmos12, open drain 2ma, 6ma ? pci33 2 n/a 3.3 hstl18 class i 8ma, 12ma 1.8 hstl18 class ii n/a 1.8 hstl15 class i 4ma, 8ma 1.5 sstl3 class i, ii n/a 3.3 sstl2 class i 8ma, 12ma 2.5 sstl2 class ii 16ma, 20ma 2.5 sstl18 class i n/a 1.8 sstl18 class ii 8ma, 12ma 1.8 differential interfaces differential sstl3, class i, ii n/a 3.3 differential sstl2, class i 8ma, 12ma 2.5 differential sstl2, class ii 16ma, 20ma 2.5 differential sstl18, class i n/a 1.8 differential sstl18, class ii 8ma, 12ma 1.8 differential hstl18, class i 8ma, 12ma 1.8 differential hstl18, class ii n/a 1.8 differential hstl15, class i 4ma, 8ma 1.5 table 8-1. supported input standards (continued) input standard v ref (nom.) v ccio 1 (nom.)
8-3 lattice semiconductor latt icexp2 sysio usage guide sysio banking scheme latticexp2 devices have eight general purpose programmable sysio banks. each of the eight general purpose sysio banks has a v ccio supply voltage, and two reference voltages, v ref1 and v ref2 . figure 8-1 shows the eight general purpose banks. on the top and bottom banks, the sysio buffer pair consis ts of two single-ended output drivers and two sets of sin- gle-ended input buffers (both ratioed and referenced). the left and right sysio buffer pair consists of two single- ended output drivers and two sets of single-ended input buffers (both ratioed and referenced). the referenced input buffer can also be configured as a differential input. true lvds support is available on only 50% of the left and right i/os (starting with the topmost pairs). there are no lvds on the top and bottom i/os. in 50% of the pairs there is also one differential output driver. the two pads in the pair are described as ?true? and ?comp?, where the true pad is associated with the positive side of the differential in put buffer and the comp (complementary) pad is associated with the negative side of the differential input buffer. spi flash interface the spi pins (master/slave) are multiplexed with the i/os in bank 7. the two dedicated pins cfg[0] and toe are powered by v cc and reside between banks 6 and 7. jtag interface the jtag pins are located between banks 2 and 3 and are powered by v ccj . figure 8-1. latticexp2 sysio banking lvds n/a 2.5 mlvds 1 n/a 2.5 blvds 1 n/a 2.5 lvpecl 1 n/a 3.3 rsds 1 n/a 2.5 1. emulated with external resistors. 2. pci33 is pcix compatible. table 8-2. supported output standards (continued) output standard drive v ccio (nom.) bank 0 bank 1 bank 5 bank 4 bank 7 bank 2 bank 3 bank 6
8-4 lattice semiconductor latt icexp2 sysio usage guide v ccio (1.2v/1.5v/1.8v/2.5v/3.3v) there are a total of eight v ccio supplies, v ccio0 - v ccio7 . each bank has a separate v ccio supply that powers the single-ended output drivers and the ratioed input buffers such as lvttl, lvcmos, and pci. lvttl, lvcmos3.3, lvcmos2.5 and lvcmos1.2 also have fixed threshold options allowing them to be placed in any bank. the v ccio voltage applied to the bank determines the ratioed input standards that can be supported in that bank. it is also used to power the differential output drivers. v ccaux (3.3v) in addition to the bank v ccio supplies, devices have a v cc core logic power supply and a v ccaux auxiliary supply that powers the differential and referenced input buffers. v ccaux is used to supply i/o reference voltage requiring 3.3v to satisfy the common-mode range of the drivers and input buffers. v ccj (1.2v/1.5v/1.8v/2.5v/3.3v) the jtag pins have a separate v ccj power supply that is independent of the bank v ccio supplies. v ccj deter- mines the electrical characteristics of the lvcmos jtag pins, both the output high level and the input threshold. table 8-3 shows a summary of all the required power supplies. table 8-3. power supplies input reference voltage (v ref1, v ref2 ) each bank can support up to two separate v ref input voltages, v ref1 and v ref2 , that are used to set the thresh- old for the referenced input buffers. the locations of these v ref pins are pre-determined within the bank. these pins can be used as regular i/os if the bank does not require a v ref voltage. v ref1 for ddr memory interface when interfacing to ddr memory, the v ref1 input must be used as the reference voltage for the dqs and dq input from the memory. a voltage divider between v ref1 and gnd is used to generate an on-chip reference volt- age that is used by the dqs transition detector circuit. this voltage divider is only present on v ref1 it is not avail- able on v ref2 . for more information on the dqs transition detect logic and its implementation, please refer to lattice technical note number tn1138, latticexp2 high speed i/o interface . for ddr1 memory interfaces, the v ref1 should be connected to 1.25v. therefore, only sstl25_ii signaling is allowed. for ddr2 memory interfaces this should be connected to 0.9v, and only sstl18_ii signaling is allowed. mixed voltage support in a bank the latticexp2 sysio buffer is connected to three parallel ratioed input buffers. these three parallel buffers are connected to v ccio , v ccaux and v cc , giving support for thresholds that track with v ccio as well as fixed thresh- olds for 3.3v (v ccaux ) and 1.2v (v cc ) inputs. this allows the input threshold for ratioed buffers to be assigned on a pin-by-pin basis rather than tracking with v ccio . this option is available for all 1.2v, 2.5v and 3.3v ratioed inputs and is independent of the bank v ccio voltage. for example, if the bank v ccio is 1.8v, it is possible to have 1.2v and 3.3v ratioed input buffers with fixed thresholds, as well as 2.5v ratioed inputs with tracking thresholds. power supply description value 1 v cc core power supply 1.2v v ccio 2 power supply for the i/o banks 1.2v/1.5v/1.8v/2.5v/3.3v v ccaux auxiliary power supply 3.3v v ccj 2 power supply for jtag pins 1.2v/1.5v/1.8v/2.5v/3.3v 1. refer to the latticexp2 family data sheet for recommended min. and max. values. 2. if v ccio or v ccj is set to 3.3v, they must be connected to the same power supply as vccaux.
8-5 lattice semiconductor latt icexp2 sysio usage guide prior to device configuration, the ratioed input thresholds always tracks the bank v ccio . this option only takes effect after configuration. output standards within a bank are always set by v ccio . table 8-4 shows the sysio stan- dards that can be mixed in the same bank. table 8-4. mixed voltage support sysio standards supported by bank table 8-5. i/o standards supported by bank v ccio input sysio standards output sysio standards 1.2v 1.5v 1.8v 2.5v 3.3v 1.2v 1.5v 1.8v 2.5v 3.3v 1.2v yes yes yes yes 1.5v yes yes yes yes yes 1 . 8 v ye s ye s ye s ye s ye s 2 . 5 v ye s ye s ye s ye s 3.3v yes yes yes yes description top side banks 0-1 right side banks 2-3 bottom side banks 4-5 left side banks 6-7 i/o buffers single-ended single-ended and differential single-ended single-ended and differential output standards supported lv t t l lv c m o s 3 3 lv c m o s 2 5 lv c m o s 1 8 lv c m o s 1 5 lv c m o s 1 2 sstl18 class i, ii sstl25 class i, ii sstl33 class i, ii hstl15 class i hstl18_i, ii sstl18d class i, ii sstl25d class i, ii sstl33d class i, ii hstl15d class i hstl18d class i, ii mlvds lv d s 2 5 e 1 lvpecl 1 blvds 1 rsds 1 lv t t l lv c m o s 3 3 lv c m o s 2 5 lv c m o s 1 8 lv c m o s 1 5 lv c m o s 1 2 sstl18 class i, ii sstl25 class i, ii sstl33 class i, ii hstl15 class i hstl18 class i, ii sstl18d class i, ii sstl25d class i, ii sstl33d class i, ii hstl15d class i hstl18d class i, ii mlvds lv d s lv d s 2 5 e 1 lvpecl 1 blvds 1 rsds 1 lvttl lv c m o s 3 3 lv c m o s 2 5 lv c m o s 1 8 lv c m o s 1 5 lv c m o s 1 2 sstl18 class i, ii sstl2 class i, ii sstl3 class i, ii hstl15 class i hstl18 class i, ii sstl18d class i, ii sstl25d class i, ii, sstl33d class i, ii hstl15d class i hstl18d class i, ii mlvds lvds25e 1 lvpecl 1 blvds 1 rsds 1 lv t t l lv c m o s 3 3 lv c m o s 2 5 lv c m o s 1 8 lv c m o s 1 5 lv c m o s 1 2 sstl18 class i sstl2 class i, ii sstl3 class i, ii hstl15 class i, iii hstl18 class i, ii, iii sstl18d class i, sstl25d class i, ii, sstl33d_i, ii hstl15d class i hstl18d class i, ii mlvds lv d s lvds25e 1 lv p e c l 1 blvds 1 rsds 1 inputs all single-ended, differential all single-ended, differential all single-ended, differential all single-ended, differential clock inputs all single-ended, differential all single-ended, differential all single-ended, differential all single-ended, differential pci support pci33 with clamp pci33 without clamp pci33 with clamp pci33 without clamp lvds output buffers lvds (3.5ma) buffers 2 lvds (3.5ma) buffers 2 1. these differential standards are implemented by using a co mplementary lvcmos driver with external resistor pack. 2. available only on 50% of the i/os in the bank.
8-6 lattice semiconductor latt icexp2 sysio usage guide lvcmos buffer configurations all lvcmos buffer have programmable pull, programmable drive and programmable slew configurations that can be set in the software. bus maintenance circuit each pad has a weak pull-up, weak pu ll-down and weak buskeeper capability. the pull-up and pull-down settings offer a fixed characteristic, which is useful in creating wired logic such as wired ors. however, current can be slightly higher than other options, depending on the signal state. the bus-keeper option latches the signal in the last driven state, holding it at a valid level with minimal power dissipation. users can also choose to turn off the bus maintenance circuitry, minimizing power dissipation and inpu t leakage. note that in this case, it is important to ensure that inputs are driven to a known state to avoid unnecessary power dissipation in the input buffer. the inter- nal weak pull-up is enabled on all unused pins. programmable drive each lvcmos or lvttl, as well as some of the referenced (sstl and hstl) output buffers, has a programmable drive strength option. this option can be set for each i/o independently. the drive strength settings available are 2ma, 4ma, 6ma, 8ma, 12ma, 16ma and 20ma. actual options available vary by the i/o voltage. the user must consider the maximum allowable current per bank and the package thermal limit current when selecting the drive strength. table 8-6 shows the available drive settings for each of the output standards. table 8-6. programmable drive values for single-ended buffers programmable slew rate each lvcmos or lvttl output buffer pin also has a programmable output slew rate control that can be configured for either low noise or high-speed performance. each i/o pin has an individual slew rate control. this allows designers to specify slew rate control on a pin-by-pin basis. this slew rate control affects both the rising and falling edges. open-drain control all lvcmos and lvttl output buffers can be configured to function as open drain outputs. the user can imple- ment an open drain output by turning on the opendrain attribute in the software. differential sstl and hstl support the single-ended driver associated wit h the complementary ?c? pad can optionally be driven by the complement of the data that drives the single-ended driver associated with the true pad. this allows a pair of single-ended drivers to be used to drive complementary outputs with the lowest possible skew between the signals. this is used for driv- ing complementary sstl and hstl signals (as required by the differential sstl and hstl clock inputs on syn- single ended i/o standard programmable drive (ma) hstl15_i 4, 8 hstl18_i 8, 12 sstl25_i 8, 12 sstl25_ii 16, 20 sstl18_ii 8, 12 lv c m o s 1 2 2 , 6 lv c m o s 1 5 4 , 8 lvcmos18 4, 8, 12, 16 lvcmos25 4, 8, 12, 16, 20 lvcmos33 4, 8, 12, 16, 20 lvttl 4, 8, 12, 16, 20
8-7 lattice semiconductor latt icexp2 sysio usage guide chronous dram and synchronous sram de vices respectively). this capability is also used in conjunction with off- chip resistors to emulate lvpec l, and blvds output drivers. table 8-7. programmable drive values for differential buffers pci support with programmable pciclamp each sysio buffer can be configured to support pci33. the buffers on the top and bottom sides of the device have an optional pci clamp diode that may optiona lly be specified in the isplever design tools. programmable pciclamp can be turned on or off. this option is available on each i/o independently on the top and bottom side banks. programmable input delay each input can optionally be delayed before it is passed to the core logic or input registers. the primary use for the input delay is to achieve zero hold time for the input registers when using a direct drive primary clock. to arrive at zero hold time, the input delay will dela y the data by at least as much as th e primary clock injection delay. this option can be turned on or off for each i/o independently in the software using the fixeddelay attribute. this attribute is described in more detail in the software sysio attribute section. appendix a shows how this feature can be enabled in the software using hdl attributes. software sysio attributes sysio attributes can be specified in the hdl, using the spreadsheet view of the design planner or in the ascii preference file (.lpf) file directly. appendices a, b and c list examples of how these can be assigned using each of these methods. this section describes each of these attributes in detail. io_type this is used to set the sysio standard for an i/o. the v ccio required to set these i/o standards are embedded in the attribute names itself. there is no separate attribute to set the v ccio requirements. table 8-8 lists the available i/o types. differential i/o standard programmable drive (ma) hstl15d_i 4, 8 hstl18d_i 8, 12 sstl25d_i 8, 12 sstl25d_ii 16, 20 sstl18d_ii 8, 12
8-8 lattice semiconductor latt icexp2 sysio usage guide table 8-8. io_type attribute values opendrain lvcmos and lvttl i/o standards can be set to open drain configuration by using the opendrain attribute. values: on, off default: off drive the drive attribute will set the programma ble drive strength for the output st andards that have programmable drive capability sysio signaling standard io_type default lvcmos25 lv d s 2 . 5 v lv d s 2 5 rsds rsds 1 emulated lvds 2.5v lvds25e 1 bus lvds 2.5v blvds25 1 lvpecl 3.3v lvpecl33 1 hstl18 class i and ii hstl18_i, htsl18_ii differential hstl 18 class i and ii hstl18d_i, hstl18d_ii hstl 15 class i hstl15_i differential hstl 15 class i hstl15d_i sstl 33 class i and ii sstl33_i, sstl33_ii differential sstl 33 class i and ii sstl33d_i, sstl3d_ii sstl 25 class i and ii sstl25_i,sstl25_ii differential sstl 25 class i and ii sstl25d_i, sstl25d_ii sstl 18 class i and ii sstl18_i, sstl18_ii differential sstl 18 class i and ii sstl18d_i,sstl18d_ii lvttl lvttl33 3.3v lvcmos lvcmos33 2.5v lvcmos lvcmos25 1.8v lvcmos lvcmos18 1.5v lvcmos lvcmos15 1.2v lvcmos lvcmos12 3.3v pci pci33 mlvds mlvds 1 1. these differential standards are im plemented by using a complementary ? lvcmos driver with external resistor pack.
8-9 lattice semiconductor latt icexp2 sysio usage guide table 8-9. drive settings pullmode the pullmode attribute is available for all the lvttl, lvcm os and pci inputs and outputs. this attribute can be enabled for each i/o independently. values: up, down, none, keeper default: up table 8-10. pullmode values pciclamp pci33 inputs on the top and bottom of the device have an optional pci clamp that is enabled via the pciclamp attribute. the pciclamp is also available for all lvcmos33 and lvttl inputs. values: on, off table 8-11. pciclamp values slewrate the slewrate attribute is available for all lvttl and lvcmos output drivers. each i/o pin has an individual slew rate control. this allows a designer to specify slew rate control on a pin-by-pin basis. values: fast, slow default: fast output standard drive (ma) default (ma) hstl15_i/ hstl15d_i 4, 8 8 hstl18_i/ hstl18d_i 8, 12 12 sstl25_i/ sstl25d_i 8, 12 8 sstl25_ii/ sstl25d_ii 16, 20 16 sstl18_ii/sstl18d_ii 8, 12 12 lvcmos12 2, 6 6 lvcmos15 4, 8 8 lvcmos18 4, 8, 12, 16 12 lvcmos25 4, 8, 12, 16, 20 12 lvcmos33 4, 8, 12, 16, 20 12 lvttl 4, 8, 12, 16, 20 12 pull options pullmode value pull-up (default) up pull-down down bus keeper keeper pull off none input type pciclamp value pci33 on (default), off lvcmos33 off (default), on lvttl off (default), on
8-10 lattice semiconductor latt icexp2 sysio usage guide fixeddelay the fixeddelay attribute is available to each input pin. this attribute, when enabled, is used to achieve zero hold time for the input registers when using global clock. this attribute can only be assigned in the hdl source. values: true, false default: false inbuf by default, all the unused input buffers are disabled. the inbuf attribute is used to enable the unused input buffers when performing a boundary scan test. this is a global attribute and can be globally set to on or off. values: on, off default: on din/dout this attribute can be used to assign i/o registers. using din will assert an i nput register and using the dout attri- bute will assert an output register. by def ault, the software will try to assign the i/o registers, if a pplicable. the user can turn this off by using the synthesis attribute or by using the spreadsheet view of the design planner. these attributes can only be applied to registers. loc this attribute can be used to make pin assignments to the i/o ports in the design. this attributes is only used when the pin assignments are made in hdl source. designers can also assign pins directly using the spreadsheet view of the design planner in the isplever software. the appendices explain this in further detail. design considerations and usage this section discusses some of the design rules and considerations that must be taken into account when design- ing with the latticexp2 sysio buffer banking rules ?if v ccio or v ccj for any bank is set to 3.3 v, it is recommended that it be connected to the same power supply as v ccaux, thus minimizing leakage. ?if v ccio or v ccj for any bank is set to 1.2v, it is recommended that it be connected to the same power supply as v cc , thus minimizing leakage. ? when implementing ddr memory interfaces, the v ref1 of the bank is used to provide reference to the interface pins and cannot be used to power any other referenced inputs. ? only the top and bo ttom banks (banks 0, 1, 4 and 5)) will support pci clamps. ? all legal input buffers should be independent of bank v ccio, except for 1.8v and 1.5v buffers, which require a bank v ccio of 1.8v and 1.5v. differential i/o rules ? all banks can support lvds input buffers. only the bank s on the right and left side s (banks 2, 3, 6 and 7) will support true differential outpu t buffers. the banks on all sides will support the lvds input buffers. the user can use emulated lvds output buffers on these banks. ? all banks support emulated differential buffers using external resistor pack and complementary lvcmos drivers. ? only 50% of the i/os on the left and right sides can pr ovide lvds output buffer capability. lvds can only be assigned to the true pad. the ispl ever design tool will automatically assign the other i/os of the differential pair to the complementary pad. refer to the device data sheet to see the pin listings for all lvds pairs.
8-11 lattice semiconductor latt icexp2 sysio usage guide differential i/o implementation the latticexp2 devices support a variety of differential standards as detailed in the following sections. lv d s true lvds (lvds25) drivers are available on 50% of the i/os on the left and right side of the devices. lvds input support is provided on all sides of the device. all four si des of the device support lvds using complementary lvc- mos drivers with external resistors (lvds25e). refer to the latticexp2 family data sheet for a detailed explana- tion of these lvds implementations. blvds all single-ended sysio buffers pairs support the bus-lvds standard using complementary lvcmos drivers with external resistors. please refer to the latticexp2 family data sheet for a detailed explanation of blvds implemen- tation. rsds all single-ended sysio buffers pairs support rsds standard using complementary lvcmos drivers with external resistors. please refer to the latticexp2 fam ily data sheet for a detailed explanation of rsds implementation. lvpecl all the sysio buffers will support lvpec l inputs. lvpecl outputs are supp orted using comple mentary lvcmos driver with external resistors. please refer to the latticexp2 family data sheet for a detailed explanation of lvpecl implementation. differential sstl and hstl all single-ended sysio buffers pairs support differential sstl and hstl. please refer to the latticexp2 family data sheet for a detailed explanation of differential hstl and sstl implementation. mlvds all single-ended sysio buffers pairs support mlvds stan dard using complementary lvcmos drivers with external resistors. please refer to the latticexp2 fam ily data sheet for a detailed explanation of mlvds implementation. technical support assistance hotline: 1-800-lattice (north america) +1-503-268-8001 (outside north america) e-mail: techsupport@latticesemi.com internet: www.latticesemi.com revision history date version change summary february 2007 01.0 initial release. april 2008 01.1 updated support ed output standards table. updated sysio banking figure. february 2009 01.2 updated i/o standards supported by bank table.
8-12 lattice semiconductor latt icexp2 sysio usage guide appendix a. hdl attributes for synplicity ? and precision ? rtl synthesis using these hdl attributes, designers can assign the sysio attributes directly in their source. the attribute defini- tion and syntax for the appropriate synthesis vendor must be used. below are a list of all the sysio attributes, syn- tax and examples for precision rtl synthesis and synplicity. this section only lists the sysio buffer attributes for these devices. th ese attributes are available throug h the isplever soft ware help system. vhdl synplicity/precis ion rtl synthesis this section lists syntax and examples for all the sysio at tributes in vhdl when using the precision rtl synthesis or synplicity synthesis tools. syntax table 8-12. vhdl attribute syntax for synplicity and precision rtl synthesis examples io_type --***attribute declaration*** attribute io_type: string; --***io_type assignment for i/o pin*** attribute io_type of porta: signal is ?pci33?; attribute io_type of portb: signal is ?lvcmos33?; attribute io_type of portc: signal is ?lvds25?; opendrain --***attribute declaration*** attribute opendrain: string; --***drive assignment for i/o pin*** attribute opendrain of portb: signal is ?on?; attribute syntax io_type attribute io_type: string; attribute io_type of pinname : signal is ?io_type value?; opendrain attribute opendrain: string; attribute opendrain of pinname: signal is ?opendrain value?; drive attribute drive: string; attribute drive of pinname: signal is ?drive value?; pullmode attribute pullmode: string; attribute pullmode of pinname: signal is ?pullmode value?; pciclamp attribute pciclamp: string; attribute pciclamp of pinname: signal is ?pciclamp value?; slewrate attribute pullmode: string; attribute pullmode of pinname: signal is ?slewrate value?; fixeddelay attribute fixeddelay: string; attribute fixeddelay of pinname: signal is ? fixeddelay value ?; din attribute din: string; attribute din of pinname : signal is ? ?; dout attribute dout: string; attribute dout of pinname: signal is ? ?; loc attribute loc: string; attribute loc of pinname: signal is ?pin_locations?;
8-13 lattice semiconductor latt icexp2 sysio usage guide drive --***attribute declaration*** attribute drive: string; --***drive assignment for i/o pin*** attribute drive of portb: signal is ?20?; pullmode --***attribute declaration*** attribute pullmode : string; --***pullmode assignment for i/o pin*** attribute pullmode of porta: signal is ?down?; attribute pullmode of portb: signal is ?up?; pciclamp --***attribute declaration*** attribute pciclamp: string; --***pullmode assignment for i/o pin*** attribute pciclamp of porta: signal is ?on?; slewrate --***attribute declaration*** attribute slewrate : string; --*** slewrate assignment for i/o pin*** attribute slewrate of portb: signal is ?fast?; fixeddelay --***attribute declaration*** attribute fixeddelay: string; --*** slewrate assignment for i/o pin*** attribute fixeddelay of portb: signal is ?true?; din/dout --***attribute declaration*** attribute din : string; attribute dout : string; --*** din/dout assignment for i/o pin*** attribute din of input_vector: signal is ? ?; attribute dout of output_vector: signal is ? ?; loc --***attribute declaration*** attribute loc : string; --*** loc assignment for i/o pin*** attribute loc of input_vector: signal is ?e3,b3,c3 ?;
8-14 lattice semiconductor latt icexp2 sysio usage guide verilog synplicity this section lists syntax and examples for all the sysio attributes in verilog using the synplicity synthesis tool. syntax table 8-13. verilog synplicity attribute syntax examples //io_type, pullmode, slewrate and drive assignment output portb /*synthesis io_type=?lvcmos33? pullmode =?up? slewrate =?fast? drive =?20?*/; output portc /*synthesis io_type=?lvds25? */; //opendrain output porta /*synthesis opendrain =?on?*/; //pciclamp output porta /*synthesis io_type=?pci33? pullmode =?pciclamp?*/; // fixeddelay input load /* synthesis fixeddelay=?true? */; // place the flip-flops near the load input input load /* synthesis din=?? */; // place the flip-flops near the outload output output outload /* synthesis dout=?? */; //i/o pin location input [3:0] data0 /* synthesis loc=?e3,b1,f3?*/; //register pin location reg data_in_ch1_buf_reg3 /* synthesis loc=?r40c47? */; //vectored internal bus reg [3:0] data_in_ch1_reg /*synthesis loc =?r40c47,r40c46,r40c45,r40c44? */; attribute syntax io_type pintype pinname /* synthesis io_type=?io_type value?*/; opendrain pintype pinname /* synthesis opendrain =?opendrain value?*/; drive pintype pinname /* synthesis drive=?drive value?*/; pullmode pintype pinname /* synthesis pullmode=?pullmode value?*/; pciclamp pintype pinname /* synthesis pciclamp =? pciclamp value?*/; slewrate pintype pinname /* synthesis slewrate=?slewrate value?*/; fixeddelay pintype pinname /* synthesis fixeddelay=?fixeddelay value?*/; din pintype pinname /* synthesis din=? ?*/; dout pintype pinname /* synthesis dout=? ?*/; loc pintype pinname /* synthesis loc=?pin_locations ?*/;
8-15 lattice semiconductor latt icexp2 sysio usage guide verilog precision this section lists syntax and examples for all the sysio attributes in verilog using the precision rtl synthesis tool. syntax table 8-14. verilog precision attribute syntax examples //****io_type *** //pragma attribute porta io_type pci33 //pragma attribute portb io_type lvcmos33 //pragma attribute portc io_type sstl25_ii //*** opendrain *** //pragma attribute portb opendrain on //pragma attribute portd opendrain off //*** drive *** //pragma attribute portb drive 20 //pragma attribute portd drive 8 //*** pullmode*** //pragma attribute portb pullmode up //*** pciclamp*** //pragma attribute portb pciclamp on //*** slewrate *** //pragma attribute portb slewrate fast //pragma attribute portd slewrate slow // ***fixeddelay*** // pragma attribute load fixeddelay true //***loc*** //pragma attribute portb loc e3 attribute syntax io_type //pragma attribute pinname io_type io_type value opendrain // pragma attribute pinname opendrain opendrain value drive // pragma attribute pinname drive drive value pullmode // pragma attribute pinname io_type pullmode value pciclamp // pragma attribute pinname pciclamp pciclamp value slewrate // pragma attribute pinname io_type slewrate value fixeddelay // pragma attribute pinname io_type fixeddelay value loc // pragma attribute pinname loc pin_location
8-16 lattice semiconductor latt icexp2 sysio usage guide appendix b. sysio attributes using the design planner user interface designers can assign sy sio buffer attributes using the design planner gui available in the isplever design tool. the pin attribute sheet list all the ports in a design and all the available sysio attributes as preferences. by clicking on each of these cells, a list of all the valid i/o preference for that port is displayed. each column takes precedence over the next. therefore, when a particular io_type is chosen, the drive, pullmode and slewrate columns will only list the valid combinations for that io_type. the pin loca tions can be locked using the pin location column of the pin attribute sheet. right-clicking on a cell will list the available pin locations. the spreadsheet view will also conduct a drc check to search fo r any incorrect pin assignments. designers can enter din/dout preferences using the cell attributes sheet of the preference editor. all the prefer- ences assigned using the preference editor are written into the preference file (.prf). figures 8-2 and 8-3 show the pin attribute sheet and the cell attribute sheet views of the preference editor. for fur- ther information on how to use the preference editor, refer to the isplever help documentation in the help menu option of the software. figure 8-2. port attributes tab figure 8-3. cell attributes tab
8-17 lattice semiconductor latt icexp2 sysio usage guide appendix c. sysio attributes us ing preference file (ascii file) designers can enter sysio attributes directly in the preference (.lpf) file as sysi o buffer preferences. the lpf file is a post-synthesis fpga constraint file that stores logica l preferences that have been created or modified in the design planner or text editor. it also contains logical preferences originating in the hdl source that have been modified. . below are a list of sysio buffer preference syntax and examples. iobuf this preference is used to as sign the attribute io_type, pullmo de, slewrate,pciclamp and drive. syntax iobuf [allports | port | group ] (keyword=)+; where: = these are not the actual top-level port names, but should be the signal name attached to the port. pios in the physical design (.ncd) f ile are named using this convention. an y multiple listings or wildcarding should be done using groups keyword = io_type, opendrain, dri ve, pullmode, pciclamp, slewrate. example iobuf port ?port1? io_type=lvttl33 opendrain=on drive=8 pullmode=up pciclamp =off slewrate=fast; define port group ?bank1? ?in*? ?out_[0-31]?; iobuf group ?bank1? io_type=sstl18_ii; locate when this preference is applied to a specified component, it places the component at a specified site and locks the component to the site. if applied to a specified macro instance, it places the macro?s reference component at a specified site, places all of the macro?s pre-placed components (that is, all components that were placed in the macro?s library file) in sites relative to the reference component, and locks all of these placed components at their sites. below are some of the locate syntax and examples. for further info rmation, refer to the isplever help documentation in the help menu option of the software. syntax locate [comp | macro ] site ; locate vref site ; note: if the comp_name, macro_name, or site_name begins with anything other than an alpha character (for exam- ple, ?11c7?), you must enclose the name in quotes. wildcard expressions are allowed in . examples this command places the port clk0 on the site a4: locate comp ?clk0? site ?a4?; this command places the component pfu1 on the site named r1c7: locate comp ?pfu1? site ?r1c7?; locate vref ?ref1? site pr29c;
8-18 lattice semiconductor latt icexp2 sysio usage guide use din cell this preference specifies the given register to be used as an input flip-flop. syntax use din cell ; where: := string example use din cell ?din0?; use dout cell specifies the given register to be used as an output flip-flop. syntax use dout cell ; where: := string example use dout cell ?dout1?; group vref this preference is used to group all the components that need to be associated to one v ref pin within a bank. syntax locate vref site ; example iobuf group bank= vref= locate vref ?ref1? site pr29c; locate vref ?ref2? site pr48b; iobuf group "group1" io_type=sstl18_ii bank=0 vref=vref1 ;
www.latticesemi.com 9-1 tn1126_01.1 february 2010 technical note tn1126 ? 2010 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. introduction this user?s guide describes the clock resources availabl e in the latticexp2? device architecture. details are pro- vided for primary clocks, secondary clocks and edge clocks as well as clock elements such as plls, clock dividers and more. the number of plls and ddr-dlls for each device is listed in table 9-1. table 9-1. number of plls and ddr-dlls clock/control distribution network latticexp2 devices provide global clock distribution in the form of eight quadrant-based primary clocks and flexible secondary clocks. two edge clocks are also provided on every edge of the device. other clock sources include clock input pins, internal nodes, plls, and clock dividers. latticexp2 top level view figure 9-1 provides a view of the primary clocking structure of the latticexp2-40 device. figure 9-1. latticexp2 clocking structure (lfxp2-40) parameter description xp2-5 xp2-8 xp2-17 xp2-30 xp2-40 number of gpllsgeneral purpose pll 22444 number of ddr-dlls ddl for ddr applications 22222 gpll sysio bank 5 sysio bank 4 sysio bank 0 sysio bank 1 sysio bank 6 sysio bank 7 sysio bank 3 sysio bank 2 gpll quadrant br quadrant bl quadrant tr quadrant tl primary clocks eclk2 eclk1 eclk2 eclk1 eclk2 eclk1 eclk2 eclk1 dqsdll gpll gpll dqsdll clkdiv clkdiv latticexp2 sysclock pll design and usage guide
9-2 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide primary clocks each quadrant receives up to eight primary clocks. two of these clocks provide the dynamic clock selection (dcs) feature. the six primary clocks without dcs can be specified in the pre-map preference editor as ?primary pure? and the two dcs clocks as ?primary-dcs?. the sources of primary clocks are: ? pll outputs ? clkdiv outputs ? dedicated clock pins ? internal nodes secondary clocks the latticexp2 secondary clocks are a flexible region-based clocking resource. each region can have four inde- pendent clock inputs. since the secondary clock is a regional resource, it can cross the primary clock quadrant boundaries. there are eight secondary clock muxes per quadrant. each mux has inputs from four different sources. three of these are from internal nodes. the fourth input comes from a primary clock pin. the input sources are not neces- sarily located in the same quadrant as the mux. this structure enables global use of secondary clocks. the sources of secondary clocks are: ? dedicated clock pins ? clock divider (clkdiv) outputs ? internal nodes table 9-2 lists the number of secondary clock regions in latticexp2 devices. table 9-2. number of secondary clock regions edge clocks the latticexp2 device has two edge clocks (eclk) per side. these clocks, which have low injection time and skew, are used to clock i/o registers. edge clock resources are designed for high speed i/o interfaces with high fanout capability. refer to appe ndix b for detailed information on ec lk locations and connectivity. the sources of edge clocks are: ? left and right edge clocks ? dedicated clock pins ? pll outputs ? pll input pins ? internal nodes ? top and bottom edge clocks ? dedicated clock pins ? internal nodes edge clocks can directly drive the secondary clock resour ces and general routing resources. refer to figure 9-21 for detailed information on edge clock routing. parameter xp2-5 xp2-8 xp2-17 xp2-30 xp2-40 number of regions 66668
9-3 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide figure 9-2 describes the structure of the secondary clocks and edge clocks. figure 9-2. latticexp2 secondary clocks and edge clocks (lfxp2-40) primary clock note the clkop must be used as the feedback source to optimize pll performance. most designers use plls for clock tree injection removal mode and the clkop should be assigned to a primary clock. this is done automatically by the so ftware unless otherwise specified by the user. clkop can route only to clk0 to clk5, while clkos/clkok can route to all primary clocks (clk0 to clk7). when clk6 or clk7 is used as a primary clock and there is only one clock input to the dcs, the dcs is assigned as a buffer mode by the software. please see the dcs section of this document for detailed information. specifying clocks in the design tools if desired, designers can specify the clock resources, primary, secondary or edge to be used to distribute a given clock source. figure 9-3 illustrates how th is can be done in the pre-map preferen ce editor. alternatively, the prefer- ence file can be used, as discussed in appendix c. primary-pure and primary-dcs primary clock net can be assigned to either primary-pure (clk0 to clk5) or primary-dcs (clk6 and clk7). global primary clock and quadrant primary clock global primary clock if a primary clock is not assigned as a quadrant clock, the software assumes it is a global clock. there are six global primary/pure clocks an d two global primary/dcs clocks available. sysio bank 5 sysio bank 4 sysio bank 0 sysio bank 1 sysio bank 6 sysio bank 7 sysio bank 3 sysio bank 2 gpll gpll eclk2 eclk1 eclk2 eclk1 eclk2 eclk2 eclk1 eclk1 dqsdll gpll gpll dqsdll secondary clock secondary clock region 2 secondary clock region 5 region 1 secondary clock region 6 secondary clock region 3 secondary clock region 4 secondary clock region 7 secondary clock region 8 dsp row dsp row ebr row
9-4 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide quadrant primary clock any primary clock may be assigned to a quadrant clock. the clock may be assigned to a single quadrant or to two adjacent quadrants (not diagonally adjacent). when a quadrant clock net is used, the user must ensure that the registers each clock drives can be assigned in that quadrant without any routing issues. in the quadrant primary clocking scheme, the maximum number of primary clocks is 32, as long as all the primary clock sources are available. figure 9-3. clock attributes in the pre-map preference editor refer to appendix a for detailed clock network diagrams. sysclock? pll the latticexp2 pll provides features such as clock in jection delay removal, frequency synthesis, phase/duty cycle adjustment, and dynamic delay adjustment. figure 9-4 shows the block diagram of the latticexp2 pll. figure 9-4. latticexp2 pll block diagram clki divider clkfb divider clkop divider phase duty cycle duty trim duty trim clkok divider lock detect rst clkfb clki wrdel dduty dphase lock clkop clkok clkos internal feedback rstk 3 phase & frequency detector voltage controlled oscillator/ loop filter clkok2
9-5 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide functional description pll divider and delay blocks input clock (clki) divider the clki divider is used to control the input clock frequency into the pll block. the divider setting directly corre- sponds to the divisor of the output clock. the input and output of the input divider must be within the input and out- put frequency ranges specified in the device data sheet. feedback loop (clkfb) divider the clkfb divider is used to divide the feedback signal. effectively, this multiplies the output clock, because the divided feedback must speed up to match the input frequency into the pll block. the pll block increases the out- put frequency until the divided feedback frequency equals the input frequency. the input and output of the feed- back divider must be within the input and output frequency ranges specified in the device data sheet. output clock (clkop) divider the clkop divider serves the dual purposes of squaring the duty cycle of the vco output and scaling up the vco frequency into the 435mhz to 870mhz range to minimize jitter. the clkop divider values are the same whether or not the clkos is used. clkok divider the clkok divider acts as a source for the global clock nets. it divides the clkop signal of the pll by the value of the divider to produce lower frequency clock. clkok2 divider the clkok2 is clkop divided by 3 for generating 140 mhz from 420 mhz to support spi4.2. phase adjustment and duty cycle select (static mode) users can program clkos with phase and duty cycle options. phase adjustment can be done in 22.5 steps. the duty cycle resolution is 1/16th of a period except 1/16th and 15/16th duty cycle options are not supported to avoid minimum pulse violation. dynamic phase adjustment (dphase) a nd dynamic duty cycle (dduty) select the phase adjustment and duty cycle select can be controlled in dynamic mode. when this mode is selected, both the phase adjustment and duty cycle select must be in dynamic mode. if only one of the features is to be used in dynamic mode, users can set the other control inputs with the fixed logic levels of their choice. duty trim adjustment with the latticexp2 device family, the duty cycle can be fine-tuned with the duty trim adjustment. fine delay adjust this optional feature is controlled by the input port, wrdel. see information on the wrdel input in the next sec- tion of this document. pll inputs and outputs clki input the clki signal is the reference clock for the pll. it must conform to the specifications in the data sheet in order for the pll to operate correctly. the clki can be derived from a dedicated dual-purpose pin or from routing. rst input the pll reset occurs under two conditions. at power-up an internal power-up reset signal from the configuration block resets the pll. the user-controlled pll reset signal rst is provided as part of the pll module that can be driven by an internally generated reset function or a pin. this rst signal resets all internal pll counters, flip-flops (including the m-divider) and the charge pump. the m-divider reset synchronizes the m-divider output to the input clock. when rst goes inactive, the pll will st art the lock-in process, and will take the t lock time to complete the pll lock. figure 9-5 shows the timing diagram of the rst input. rst is active high. the rst signal is optional.
9-6 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide figure 9-5. rst input timing diagram rstk input rstk is the reset input for the k-divider . this k-divider reset is used to synchronize the k-divider output clock to the input clock. latticexp2 has an optional gearbox in the i/o cell for both outputs and inputs. the k-divider reset is useful for the gearbox implementation. rstk is active high. clkfb input the feedback signal to the pll, which is fed through the feedback divider, can be derived from the primary clock net (clkop), a preferred pin, directly from the clkop divi der or from general routing. external feedback allows the designer to compensate for board-level clock alignment. clkop output the sysclock pll main clock output, clkop, is a signal av ailable for selection as a primary clock. this clock sig- nal is available at the clk_out pin. clkos output with pha se and duty cycle select the sysclock pll auxiliary clock output, clkos, is a si gnal available for selectio n as a primary clock. the clkos is used when phase shift and/or duty cycle adjustment is desired. the programmable phase shift allows for different phase in increments of 22.5. the duty select feature provides duty select in 1/16th of the clock period. this feature is also supported in dynamic control mode. clkok output with lower frequency the clkok is used when a lower frequency is desired. it is a signal available for selection as a primary clock. clkok2 output this extra clock is provided for spi4.2 application. the 420 mhz clkop clock is divided by 3, producing 140 mhz. the clock can also be used for any applications where clkop-divided-by-3 is required. lock output the lock output provides information about the status of the pll. after the device is powered up and the input clock is valid, the pll will achieve lock within the specified lo ck time. once lock is achieved, the pll lock signal will be asserted. if, during operation, the input clock or feed back signals to the pll become invalid, the pll will lose lock. however, when the input clock completely stops, the lo ck output will remain in its la st state, since it is inter- nally registered by this clock. it is recommended to assert pll rst to re-synchronize the pll to the reference clock. the lock signal is available to the fpga routing to implement generation of rst. modelsim ? simulation models take two to four reference clock cycles from rst release to lock high. dynamic phase and dynamic duty cycle adjustment the dphase[3:0] port is used with the dynamic phase adjustment feature to allow the user to connect a control signal to the pll. the dduty[3:0] port is used with the dynamic duty adjustment feature to allow the user to con- nect a control signal to the pll. the dph ase and dduty ports are listed in table 9-3. the dynamic phase and dynamic duty cycl e adjustment features will be discuss ed in more detail in later sections of this document. t lock t rst pll_rst lock
9-7 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide table 9-3. dynamic phase and duty cycle adjust ports wrdel (write delay) the fine delay option supports spi4.2. the pll has a coarse phase adjust feature in which a cycle is divided into 16 equal steps (22.5). for spi4.2 running at 840 mbps, the clock frequency is 420 mhz. at this frequency, the period is roughly 150 ps. this is slightly too coarse for dynamic phase adjust requirements. it may be more effective to use increments half as large. combined with coarse phase adjust, a 70 ps (nominal) step provides effectively 32 steps of phase adjustment. this fine delay only applies to clkos (just like the coarse phase adjust). this is conve- nient since it allows one gpll to be used for both read and write (where read uses clkos and write uses clkop). pll attributes the pll utilizes several attributes that allow the configuration of the pll through source constraint s and a prefer- ence file. the following section details these attributes and their usage. fin the input frequency can be any value within the specified frequency range based on the divider settings. clki_div, clkfb_div, clkop_div, clkok_div these dividers determine the output frequencies of each output clock. the user is not allowed to input an invalid combination. valid combinations are determined by the input frequency, the dividers, and the pll specifications. note: unlike plls in the latticeecp?, latticeec?, latticexp? and machxo? devices, the clkop divider val- ues are the same whether or not clkos is used. the clkop_div value is calculated to maximize the f vco within the specified range based on fin and clkop_freq in conjunction with the clki_div and clkfb_div values. these value settings are designed such that the output clock duty cycle is as close to 50% as possible. table 9-4 shows the possible divider ranges. table 9-4. divider ranges frequency_pin_clki, frequency_p in_clkop, frequency_pin_clkok these input and output clock frequencies determine the divider values. clkop frequency tolerance when the desired output frequency is not achievable, users may enter the frequency tolerance of the clock output. phaseadj (phase shift adjust) the phaseadj attribute is used to sele ct phase shift for clkos output. th e phase adjustment is programmable in 22.5 increments. port name i/o description dphase[3:0] i dynamic phase adjust inputs dduty[3:0] i dynamic duty cycle adjust inputs attribute name value default clki divider setting clki_div 1 to 43 1 clkfb divider setting clkfb_div 1 to 43 1 clkop divider setting clkop_div 2, 4, 8, 16, 32, 48, 64, 80 8 clkok divider setting clkok_div 2, 4, 6,.., 126, 128 2
9-8 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide duty (duty cycle) the duty attribute is used to select the duty cycle for clkos output. the duty cycle is programmable at 1/16th of the period increment. steps 2 to 14 are supported. 1/16th and 15/16th duty cycles are not supported to avoid the minimum pulse width violation. fb_mode there are three sources of feedback signals that can drive the clkfb divider: internal, clkop (clock tree) and user clock. clkop (clock tree) feedback is used by default. internal feedback takes the clkop output at clkop divider output before the clock tree to minimize the feedback path delay. the user clock feedback is driven from the dedicated pin, clock pin or user-specified internal logic. duty_trim adjustment (dynamic mode only) users can fine tune the duty cycle of clkop and/or clkos with the duty_trim feature when dynamic phase/duty adjustment is selected. ? trim polarity select: users can select either rising edge or falling edge of clock to trim. ? trim delay of clkop can be set to 0 to 7 steps of unit trim delay. ? trim delay of clkos can be set to 0 to 3 steps of unit trim delay. clkos/clkok/clkok2 select users select these output clocks onl y when they are used in the design. clkop/clkos/clkok bypass these bypasses are enabled if set. clki is directly routed to its corresponding output clock. rst/rstk select users may select these reset signals only when they are used in the design. latticexp2 pll pr imitive definition one pll primitive is used for latticexp2 pll implementation. figure 9-6 shows the latticexp2 pll primitive library symbols. figure 9-6. latticexp2 pll primitive symbol eplld design migration from latticeecp2 to latticexp2 the eplld generated for latticeecp2 can be used with minor changes. if the configuration does not include dynamic phase and duty options, the migration is fully supported. if dynamic phase and duty options are included, the user must tie the dpamode port to ground. dynamic phase/duty mode this mode sets both dynamic phase adjustment and dynamic duty select at the same time. there are two modes, ?dynamic phase and dynamic duty? and ?dynamic phase and 50% duty?. dynamic phase and 50% duty this mode allows users to set up dynamic phase inputs on ly. the 50% duty cycle is handled internally by the isp- lever ? software. the dduty[3:0] ports are user-transparent in this mode. ehxplle rst rstk clki clkfb wrdel dphase[3:0] dduty[3:] clkop clkos clkok clkok2 lock
9-9 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide dynamic phase and dynamic duty this mode allows designers to use both ddphase[3:0 ] and dduty[3:0] ports to input dynamic values. to use dynamic phase adjustment with a fixed duty cycle other than a 50%, simply se t the dduty[3:0] inputs to the desired duty cycle value. figure 9-7 illustrates an example circuit. example: assume a design uses dynamic phase adjustment and a fixed duty cycle select and the desired duty cycle in 3/16th of a period. the setup should be as shown in figure 9-7. figure 9-7. example of dynamic phase adjustment with a fixed duty cycle of 3/16th of a period dynamic phase adjustment/duty cycle select phase adjustment settings are described in table 9-5. table 9-5. phase adjustment settings dphase[3:0] phase () 0000 0 0001 22.5 0010 45 0011 67.5 0100 90 0101 112.5 0110 135 0111 157.5 1000 180 1001 202.5 1010 225 1011 247.5 1100 270 1101 292.5 1110 315 1111 337.5 dphase[3] dphase[2] dphase[1] dphase[0] dpamode pll dduty[3] dduty[2] dduty[1] dduty[0] dphase[3:0]
9-10 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide duty cycle select settings are described in table 9-6. table 9-6. duty cycle select settings pll usage in ipexpress? ipexpress is used to create and configure a pll. the graphical user interface is used to select parameters for the pll. the result is an hdl model to be used in the simulation and synthesis flow. figure 9-8 shows the main window when pll is selected. the only entry required in this window is the module name. other entries are set to the project settings. users may change these entries, if desired. after entering the module name of choice, clicking on customize will open the configuration tab window as shown in figure 9. dduty[3:0] duty cycle (1/16th of a period) comment 0000 0 not supported 0001 1 not supported 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 10 1011 11 1100 12 1101 13 1110 14 1111 15 not supported note: phase/duty_ctnl is selected in the gui ?pll phase & duty options? box and if it is set to ?dynamic mode?, then both dphase[3:0] and dduty[3:0] inputs must be provided. if one of these inputs is a fixed value, the inputs must be tied to the desired fixed logic levels.
9-11 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide figure 9-8. ipexpress main window configuration tab the configuration tab lists all user accessible attribut es with default values set. upon completion, clicking gener- ate will generate source and constraint files. users may choose to use the .lpc file to load parameters. configuration modes there are two modes that can be used to configure the pl l in the configuration tab, frequency mode and divider mode. frequency mode: in this mode, the user enters input and output clock frequencies and the software calculates the divider settings. if the output frequen cy entered is not achievable the near est frequency will be displayed in the ?actual? text box. after input and output frequencies are entered, clicking the calculate button will display the divider values. divider mode: in this mode, the user sets the divider settings with input frequency. users must choose the clkop divider value to maximize the f vco and achieve optimum pll performance. after input frequency and divider set- tings are set, clicking the calculate button will display the frequencies. fi gure 9-9 shows the configuration tab.
9-12 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide figure 9-9. latticexp2 pll configuration tab table 9-7 describes the user parameters in the ipexpress gui and their usage. table 9-7. user parameters in the ipexpress gui user parameters description range default frequency mode user desired clki and clkop frequency on/off on divider mode user desired clki frequency and dividers settings on/off off clki frequency input clock frequency 10 mhz to 435 mhz 100 mhz divider input clock divider setting (divider mode) 1 to 43 1 clkfb feedback mode feedback mode internal, clkop, user clock clkop divider feedback clock divider setting (divider mode) 1 to 43 1 pll phase & duty options none no phase & duty options on/off on static mode clkos phase/duty in static mode on/off off dynamic mode clkos dynamic mode phase/duty ? setting on/off off clkos duty trimming on/off off clkop duty trimming on/off off
9-13 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide pll modes of operation plls have many uses within a logic design. the two most popular are clock injection removal and clock phase adjustment. these two modes of operation are described below. pll clock injection removal in this mode the pll is used to reduce clock injection delay. clock injection delay is the delay from the input pin of the device to a destination element such as a flip-flop. the phase detector of the pll aligns the clki with clkfb. if the clkfb signal comes from the clock tree (clkop), then the pll delay and the clock tree delay is removed. figure 9-10 illustrates an example block diagram and waveform. clkop bypass bypass pll: clkop = clki on/off off desired frequency user enters desired clkop frequency 10 mhz to 435 mhz 100 mhz divider clkop divider setting (divider mode) 2, 4, 8, 16, 32, 48, 64, 80 8 tolerance clkop tolerance users can tolerate 0.0, 0.1, 0.2, 0.5, 0.1, 0.2, 0.5, 1.0 0.0 actual frequency actual frequency achievable. read only ? ? rising rising edge trim on/off off falling falling edge trim on/off off delay multiplier number of delay steps 0 to 7 0 clkos enable enable clkos output clock on/off off bypass bypass pll: clkos = clki on/off off phase shift clkos static phase shift 0, 22.5, 45..337.5 0 rising rising edge trim on/off off delay multiplier number of delay steps 0 to 7 0 clkok enable enable clkos output clock on/off off bypass bypass pll: clkok = clki on/off off frequency user enters desired clkok frequency 78.125 khz to 217.5 mhz 50 mhz divider clkok divider setting 2 to 128 2 tolerance clkok tolerance users can tolerate 0.0, 0.1, 0.2, 0.5, 0.1, 0.2, 0.5, 1.0 0.00 actual frequency actual frequency achievable. read only ? ? clkok2 enable enable clkok2 output clock on/off off provide pll reset provide pll reset port (reset) on/off off provide clkok divide reset provide clkok reset port (rstk) on/off off provide clkos fine delay port provide clkos fine delay port (wrdel) on/off off import lpc to isplever project import .l pc file to isplever project on/off off table 9-7. user parameters in the ipexpress gui (continued) user parameters description range default
9-14 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide figure 9-10. clock injection delay removal application pll clock phase adjustment in this mode the pll is used to create fixed phase relationships in 22.5 increments. creating fixed phase relation- ships is useful for forward clock interfaces where a spec ific relationship between cl ock and data is required. the fixed phase relationship can be used between clki and clkos or between clkop and clkos. figure 9-11. clkos phase adjustment from clkop ipexpress output there are two ipexpress outputs that are important for use in the design. the first is the .[v|vhd] file. this is the user-named module that was generated by the tool to be used in both synthesis and simulation flows. the second is a template file, _tmpl.[v|vhd]. this file contains a sample instantiation of the module. this file is provided for the user to copy/paste the instance and is not intended to be used in the synthesis or simulation flows directly. for the pll, ipexpress sets attributes in the hdl module that are specific to the data rate selected. although these attributes can be easily changed, they should only be mo dified by re-running the gui so that the performance of the pll is maintained. after the map stage in the design flow, frequency preferences will be included in the preference file to automatically cons train the clocks produced from the pll. clki clock at clock tree without pll clkop/clkos at clock tree with pll clock injection delay pll clki clkfb clkop clock tree clki clkop clkos with 90 phase shift pll clki clkfb clkop clkos
9-15 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide use of the pre-map preference editor clock preferences can be set in the pre-map preference editor. figure 9-12 shows an example screen shot. the pre-map preference editor is a part of the isplever design planner. figure 9-12. pre-map preference editor example clock dividers (clkdiv) the clock divider divides the high-speed clock by 1, 2, 4 or 8. all the outputs have matched input to output delay. clkdiv can take as its input the edge clocks and the clkop of the pll. the divided outputs drive the primary clock and are also available for general routing or secondary clocks. the clock dividers are used for providing the low speed fpga clocks for shift registers (x2, x4, x8) and ddr/spi4 i/o logic interfaces. clkdiv primitive definition users can instantiate clkdiv in the source code as defined in this section. figure 9-13 and tables 9-8 and 9-9 describe the clkdivb definitions. figure 9-13. clkdiv primitive symbol clkdivb cdiv1 cdiv2 cdiv4 cdiv8 clki rst release
9-16 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide table 9-8. clkdivb port definition table 9-9. clkdivb attribute definition clkdiv declaration in vhdl source code component clkdivb -- synthesis translate_off generic ( gsr : in string); -- synthesis translate_on port ( clki,rst, release:in std_logic; cdiv1, cdiv2, cdiv4, cdiv8:out std_logic); end component; attribute gsr : string; attribute gsr of clkdivinst0 : label is ?disabled?; begin clkdivinst0: clkdivb -- synthesis translate_off generic map( gsr => ?disabled? ); -- synthesis translate_on port map( clki => clkisig, rst => rstsig, release => releasesig, cdiv1 => cdiv1sig, cdiv2 => cdiv2sig, cdiv4 => cdiv4sig, cdiv8 => cdiv8sig ); name description clki clock input rst reset input, asynchronously forces all outputs low. release releases outputs synchronously to input clock. cdiv1 divided by 1 output cdiv2 divided by 2 output cdiv4 divided by 4 output cdiv8 divided by 8 output name description value default gsr gsr enable enabled/disabled disabled
9-17 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide clkdiv usage with verilog - example module clkdiv_top(rst,clki,release,cdiv1,cdiv2,cdiv4,cdiv8); input clki,rst,release; output cdiv1,cdiv2,cdiv4,cdiv8; clkdivb clkdibinst0 (.rst(rst),.clki(clki),.release(release), .cdiv1(cdiv1),.cdiv2(cdiv2),.cdiv4(cdiv4),.cdiv8(cdiv8)); defparam clkdibint0.gxr = ?disabled?; endmodule clkdiv example circuits the clock divider (clkdiv) can divide a clock by 2 or 4 and drives a primary clock network. clock dividers are use- ful for providing the low speed fpga clocks for i/o shift registers (x2, x4) and ddr (x2, x4) i/o logic interfaces. divide by 8 is provided for slow speed/low power operation. to guarantee a synchronous transfer in the i/o logic the clkdiv input clock must come from an edge clock and the output drive from a primary clock. in this case, they are phase matched. it is especially useful to synchronously reset the i/o logic when mux/demux gearing is used in order to synchronize the entire data bus as shown in figure 9-14. using the low skew characteristics of the edge clock routing a reset can be provided to all bits of the data bus to synchronize the mux/demux gearing. the second circuit shows that a dll can replace clkdiv for x2 and x4 applications. figure 9-14. clkdiv application example clkdiv eclk data dq gearing (2x) rst primary clock 8 16
9-18 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide reset behavior figure 9-15 illustrates the as ynchronous rst behavior. figure 9-15. clkdiv reset behavior release behavior the port, ?release? is used to synchronize the all outputs after rst is de-asserted. figure 9-16 illustrates the release behavior. figure 9-16. clkdiv release behavior clki rst cdiv1 cdiv2 cdiv4 cdiv8 rst asserted asynchronously. all clock outputs are forced low. de-asserted rst is registered. after de-asserted rst is registered all outputs start toggling. clki rst release cdiv1 cdiv2 cdiv4 cdiv8 de-asserted rst registered clock start counting release synchronizes outputs
9-19 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide clkdiv inputs-to-outputs delay matching figure 9-17. clkdiv inputs-to-outputs delay matching dcs (dynamic clock select) dcs is a global clock buffer incorporating a smart multiplexer function that takes two independent input clock sources and avoids glitches or runt pulses on the output clock, regardless of where the enable signal is toggled. there are two dcss for each quadrant. the outputs of the dcs then reach primary clock distribution via the feedlines. figure 9-18 shows the block dia- gram of the dcs. figure 9-18. dcs primitive symbol dcs primitive definition table 9-10 defines the i/o ports of the dcs block. there are eight modes to select from. table 9-11 describes how each mode is configured. table 9-10. dcs i/o definition i/o name description input sel input clock select clk0 clock input 0 clk1 clock input 1 output dcsout clock output clki cdiv1 cdiv2 cdiv4 cdiv8 dcs dcsout clk0 sel clk1
9-20 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide table 9-11. dcs modes of operation dcs timing diagrams each mode performs a unique operation. the clock output timing is determined by input clocks and the edge of the sel signal. figure 9-19 describes the timing of each mode. figure 9-19. timing diagrams by dcs mode attribute name description output value sel=0 sel=1 dcs mode rising edge triggered, latched state is high clk0 clk1 pos falling edge triggered, latched state is low clk0 clk1 neg sel is active high, disabled output is low 0 clk1 high_low sel is active high, disabled output is high 1 clk1 high_high sel is active low, disabled output is low clk0 0 low_low sel is active low, disabled output is high clk0 1 low_high buffer for clk0 clk0 clk0 clk0 buffer for clk1 clk1 clk1 clk1 clk0 clk1 sel dcsout clk0 clk1 sel dcsout sel falling edge: - wait for clk1 falling edge, latch output & remain low - switch output at clk0 falling edge sel rising edge: - wait for clk0 falling edge, latch output & remain low - switch output at clk1 falling edge sel falling edge: - wait for clk1 rising edge, latch output & remain high - switch output at clk0 rising edge sel rising edge: - wait for clk0 rising edge, latch output & remain high - switch output at clk1 rising edge dcs mode = neg dcs mode = pos
9-21 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide figure 9-20. timing diagrams by dcs mode (cont.) dcs usage with vhdl - example component dcs -- synthesis translate_off generic ( dcsmode : string := ?pos? ; -- synthesis translate_on port ( end component; attribute dcsmode : string; attribute dcsmode of dcsinst0 : label is ?pos?; begin dcsinst0: dcs -- synthesis translate_off generic map ( clk1 sel dcsout - switch low @clk1 falling edge. - if sel is low, output stays low at on clk1 rising edge. sel must not change during setup prior to rising clock. dcs mode = high_low clk0 sel dcsout - switch low @clk0 falling edge. - if sel is high, output stays low at on clk0 rising edge. dcs mode = low_low clk1 sel dcsout - switch high @clk1 rising edge. - if sel is low, output stays low high on clk1 falling edge. dcs mode = high_high clk0 sel dcsout - switch high @ clk0 rising edge. - if sel is high, output stays high on clk0 falling edge. dcs mode = low_high
9-22 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide dcsmode => ?pos? ) -- synthesis translate_on port map ( sel => clksel, clk0 => dcsclk0, clk1 => sysclk1, dcsout => dcsclk ); dcs usage with ve rilog - example module dcs(clk0,clk1,sel,dcsout); input clk0, clk1, sel; output dcsout; dcs dcsinst0 (.sel(sel),.clk0(clk0),.clk1(clk1),.dcsout(dcsout)); defparam dcsinst0.dcsmode = ?clk0?; endmodule oscillator (osce) there is a dedicated oscillator in the latticexp2 device whose output is made available for users. the oscillator frequency output is routed through a divide r which is used as an input clock to the clock tree. the available outputs of the divider are shown in table 9-13. the oscillator frequ ency output can be further divided by internal logic (user logic) for lower frequencies, if desired. the oscillato r is powered down when not in use. the output of this oscillator is not a prec ision clock. it is intended as an extr a clock that does not require accurate clocking. primitive name: osce table 9-12. osce port definition table 9-13. osce attribute definition osc primitive symbol (osce) figure 9-21. osc symbol i/o name description output osc oscillator clock output user attribute attribute na me value (mhz) default value nominal frequency nom_freq 2.5, 3.14, 4.3, 5.4, 6.9, 8.1, 9.2, 10, 13, 15, 20, 26, 32, 40, 54, 80, 163 2.5 osce osc
9-23 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide osc usage with vhdl - example component osce port (osc:out std_logic); end component; begin oscinst0: osce port map ( osc=> osc_int); osc usage with verilog - example module osc_top(osc_clk); output osc_clk; osce oscinst0 (.osc(osc_clk)); endmodule setting clock preferences designers can use clock preferences to implement clocks to the desired performance. preferences can be set in the pre-map preference editor (design planner) or in preference files. frequently used preferences are described in appendix c. power supplies each pll has its own power supply pin, vccpll. since vcc and vccpll are normally the same 3.3v, it is rec- ommended that they are driven from the same power supply on the circuit board, thus minimizing leakage. in addi- tion, each of these supplies should be independently isolated from the main 3.3v supply on the board using proper board filtering techniques to minimize the noise coupling between them. technical support assistance hotline: 1-800-lattice (north america) +1-503-268-8001 (outside north america) e-mail: techsupport@latticesemi.com internet: www.latticesemi.com revision history date version change summary february 2007 01.0 initial release. february 2010 01.1 reconciled lock description among machxo, latticexp2, latticeecp2/m and latticeecp3.
9-24 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide appendix a. primary clock sources and distribution figure 9-22. latticexp2 primary clock sources and distribution figure 9-23. latticexp2 primary clock muxes primary clocks in center switch box gpll* : available in xp2-17 and larger devices general routing quadrant tl general routing quadrant tr 2 3 dcs 36:1 36:1 36:1 36:1 36:1 36:1 32:1 32:1 32:1 32:1 dcs dcs 36:1 36:1 36:1 36:1 36:1 36:1 32:1 32:1 32:1 32:1 dcs general routing quadrant bl general routing quadrant br 2 3 clk0 clk0 clk1 clk1 clk2 clk2 clk3 clk3 clk4 clk4 clk5 clk5 clk6 clk6 clk7 clk0 clk1 clk2 clk3 clk4 clk5 clk6 clk7 clk7 clk0 clk1 clk2 clk3 clk4 clk5 clk6 clk7 dcs 36:1 36:1 36:1 36:1 36:1 36:1 32:1 32:1 32:1 32:1 dcs dcs 36:1 36:1 36:1 36:1 36:1 36:1 32:1 32:1 32:1 32:1 dcs pclkt7 pclkt6 pclkt2 pclkt3 pclkt4 pclkt5 pclkt0 clkdiv clkdiv1 clkdiv2 clkdiv4 clkdiv8 gpll* clkop clkos clkok clkok2 gpll clkop clkos clkok clkok2 clkdiv clkdiv1 clkdiv2 clkdiv4 clkdiv8 gpll* clkop clkos clkok clkok2 gpll clkop clkos clkok clkok2 pclkt1 clk6 - 7 16 pll outputs 8 clkdiv outputs 4 pclk pins 2 from general routing clk0 - 5 16 pll outputs 8 clkdiv outputs 4 pclk pins general routing vcc dcs 30:1 29:1
9-25 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide appendix b. pll, cl kdiv and eclk locatio ns and connectivity figure 9-24 shows the locations, site names and connectivity of the plls, clkdivs and eclks figure 9-24. pll, clkdiv and eclk locations and connectivity eclk1 eclk2 eclk1 eclk2 eclk2 eclk1 ecl k1 ecl k2 pclkt7 ulgpll_in internal node llgpll_in clkop clkos ulgpll clkop clkos llgpll internal node pclkt6 pclkt2 urgpll_in internal node lrgpll_in internal node pclkt3 internal node internal node internal node rclkdiv lclkdiv internal node pclkt4 pclkt5 pclkt1 pclkt0 clkop clkos lrgpll clkop clkos urgpll
9-26 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide appendix c. clock preferences a few key clock preferences are introduced below. refer to the ?help? file for other preferences and detailed infor- mation. asic the following preference command assigns a phase of 90 degrees to the cimdlla clkop. asic ?my_dll? type ?cimdlla? clkop_phase=90; frequency the following physical preference command assigns a frequency of 100 mhz to a net named clk1: frequency net ?clk1? 100 mhz; the following preference specifies a hold margin value for each clock domain: frequency net ?rx_clka_cmos_c? 100.000 mhz hold_margin 1 ns; maxskew the following command assigns a maximum skew of 5 nanoseconds to a net named netb: maxskew net ?netb? 5 ns; multicycle the following command will relax the period to 50 nanoseconds for the path st arting at compa to compb (net1): multicycle ?path1? start comp ?compa? end comp ?compb? net ?net1? 50 ns ; period the following command assigns a clock period of 30 nanoseconds to the port named clk1: period port ?clk1? 30 ns; prohibit this command prohibits the use of a primar y clock to route a clock net named bf_clk: prohibit primary net ?bf_clk?; use primary use a primary clock resource to route the specified net: use primary net clk_fast; use primary dcs net ?bf_clk?; use primary pure net ?bf_clk? quadrant_tl; use secondary use a secondary clock resource to route the specified net: use secondary net ?clk_lessfast? quadrant_tl;
9-27 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide use edge use a edge clock resource to route the specified net: use edge net ?clk_fast?; clock_to_out specifies a maximum allowable outp ut delay relative to a clock. here are two preferences using both the clkport and clknet keywords showing the corresponding scope of trace reporting. the clknet will stop tracing the path before the pll, so you will not get pll comp ensation timing numbers. clock_to_out port ?rxaddr_0? 6.000000 ns clknet ?pll_rxclk? ; the above preference will yiel d the following clock path: clock path pll_inst/pll_utp_0_0 to pfu_33: name fanout delay (ns) site resource route 49 2.892 ulppll.mclk to r3c14.clk0 pll_rxclk -------- 2.892 (0.0% logic, 100.0% route), 0 logic levels. if clkport is used, the trace is complete back to the clock port resource and provides pll compensation timing numbers. clock_to_out port ?rxaddr_0? 6.000000 ns clkport ?rxclk? ; the above preference will yiel d the following clock path: clock path rxclk to pfu_33: name fanout delay (ns) site resource in_del --- 1.431 d5.pad to d5.inck rxclk route 1 0.843 d5.inck to ulppll.clkin rxclk_c mclk_del --- 3.605 ulppll.clkin to ulppll.mclk pll_inst/pll_utp_0_0 route 49 2.892 ulppll.mclk to r3c14.clk0 pll_rxclk -------- 8.771 (57.4% logic, 42.6% route), 2 logic levels. input_setup specifies an setup time requirement for input ports relative to a clock net. input_setup port ?datain? 2.000000 ns hold 1.000000 ns clkport ?clk? pll_phase_back ; pll_phase_back this preference is used with input_setup when a user needs a trace calculation based on the previous clock edge. this preference is useful when setting the pll output phase adjustment. since there is no negative phase adjust- ment provided, the pll_phase_back preference works as if negative phase ad justment is available.
9-28 latticexp2 sysclock pll lattice semiconductor desi gn and usage guide for example: if phase adjustment of -90 of clkos is desired, a user can set the phase to 270 and set the input_setup preference with pll_phase_back. pll_phase_back usage in pre-map preference editor the pre-map preference editor can be used to set the pll_phase_back attribute. 1. open the design planner (pre-map). 2. in the design planner control window, select view -> spreadsheet view . 3. in the spreadsheet view window, select input_setup/clock_to_out... the input_setup/clock_to_out preference window is shown in figure 9-25. figure 9-25. input_setup/clock_to_out preference window
www.latticesemi.com 10-1 tn1137_01.8 november 2008 technical note tn1137 ? 2008 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. introduction this technical note discusses memory usage for the latticexp2? device family. it is intended to be used by design engineers as a guide for integrating the user tag, ebr- (embedded block ram) and pfu-based memories in this device family using the isplever ? design tool. the architecture of these devices provides resources for fpga on-chip memory applications. the sysmem? ebr complements the distributed pfu-based memory. single-port ram, dual-port ram, pseudo dual-port ram, fifo and rom memories can be constructed using the ebr. luts and pfu can implement distributed single-port ram, dual-port ram and rom. user tag memories in varying sizes, depending on the specific chip, are also on the device. the capabilities of the user tag memory, ebr ram and pfu ram are referred to as pr imitives and are described later in this docume nt. designers can utilize the memory primitives in two ways via the ipexpress? tool in the isp- lever software. the ipexpress gui allows users to specify the memory type and size required. ipexpress takes this specification and constructs a netlist to implement the desired memory by using one or more of the memory primitives. the remainder of this document discusses the use of ipexpress, memory modules and memory primitives. memories in latticexp2 devices there are two kinds of logic blocks, the programmable functional unit (pfu) and programmable functional unit without ram (pff). the pfu contains the building blocks for logic, arithmetic, ram, rom and register functions. the pff block contains building blocks for logic, arithmet ic and rom functions. both pfu and pff blocks are opti- mized for flexibility allowing complex designs to be implem ented quickly and efficiently. logic blocks are arranged in a two-dimensional array. only one type of block is used per row. the latticexp2 family of devices contains up to two ro ws of sysmem ebr blocks. sysmem ebrs are large, dedi- cated 18k fast memory blocks. each sysmem block can be configured in a variety of depths and widths of ram or rom. each latticexp2 device also contains one dedicated row of user tag memory with up to 451 bytes of space. table 10-1. latticexp2 lut and memory densities parameter xp2-5 xp2-8 xp2-17 xp2-30 xp2-40 ebr rows 11112 ebr blocks 9 12152148 ebr bits 165888 221184 276480 387072 884736 distributed ram bits 10368 18432 34560 64512 82944 total memory bits 176256 239616 311040 451584 967680 latticexp2 memory usage guide
10-2 lattice semiconductor lattice xp2 memory usage guide figure 10-1. simplified block diag ram, latticexp2 device (top level) utilizing ipexpress designers can utilize ipexpress to easily specify a variet y of memories in their de signs. these modules are con- structed using one or more memory primitives along with general purpose routing and luts, as required. the available primitives are: ? single port ram (ram_dq) ? ebr-based ? dual port ram (ram_dp_true) ? ebr-based ? pseudo dual port ram (ram_dp) ? ebr-based ? read only memory (rom) ? ebr-based ? first in first out memory (dual clock) (fifo_dc) ? ebr-based ? distributed single port ram (distributed_spram) ? pfu-based ? distributed dual port ram (distributed_dpram) ? pfu-based ? distributed rom (distributed_rom) ? pfu/pff-based ? user tag memory (sspia) ? tag-based on-chip oscillator programmable function units (pfus) spi port sysclock plls flexible routing flash jtag port sysio buffers, pre-engineered source synchronous support sysmem block ram dsp blocks
10-3 lattice semiconductor lattice xp2 memory usage guide ipexpress flow for generating any of these memories, create (or open) a project for the latticexp2 devices. from the project navigator, select tools > ipexpress or click on the button in the toolbar when latticexp2 devices are targeted in the project. this opens the ipexpress main window as shown in figure 10-2. figure 10-2. ipexpress - main window the left pane of this window includes the module tree. the ebr-based memory modules are under the ebr_components and the pfu-based distributed memory modules are under storage_components , as shown in figure 10-2. as an example, let us consider generating an ebr-based pseudo dual port ram of size 512x16. select ram_dp under ebr_components . the right pane changes as shown in figure 10-3.
10-4 lattice semiconductor lattice xp2 memory usage guide figure 10-3. example generating pseudo dual port ram (ram_dp) using ipexpress in the right pane, options like the device family , macro type , category , and module_name are device and selected module dependent. these cannot be changed in ipexpress. users can change the directory wh ere the generated module files will be placed by clicking the browse button in the project path . the module name text box allows users to specify an entity name for the module they are about to generate. users must provide this entity name. design entry , verilog or vhdl, by default, is the same as the project type. if the project is a vhdl project, the selected design entry option will be ?sch ematic/ vhdl?, and ?schematic/ verilog- hdl? if the project type is verilog- hdl. the device pull-down menu allows users to se lect different devices within the same family, latticexp2 in this example. by clicking the customize button, another window opens where users can customize the ram (figure 10-4).
10-5 lattice semiconductor lattice xp2 memory usage guide figure 10-4. example generating pseudo dual port ram (ram_dp) module customization the left side of this window shows the block diagram of the module. the right side includes the configuration tab where users can choose options to customize the ram_dp (e.g. specify the address port sizes and data widths). users can specify the address depth and data width for the read port and the write port in the text boxes pro- vided. in this example, we are generating a pseudo dual port ram of size 512 x 16. users can also create rams of different port widths for pseudo dual port and true dual port rams. the input data and the address control are always registered, as the hardware only supports the clocked write operation for the ebr based rams. the check box enable output registers inserts the output registers in the read data port. output registers are optional for ebr-based rams. users have the option to set the reset mode as asynchronous reset or synchronous reset. enable gsr can be checked to enable the global set reset. users can also pre-initialize their memo ry with the contents specified in the memory file . it is optional to provide this file in the ram; however for rom, the memory file is required. these files can be of binary, hex or addresses hex format. the details of these formats are discussed in the initialization file section of this document. at this point, users can click the generate button to generate the module they have customized. a vhdl or verilog netlist is then generated and placed in the specified location. users can incorporate this netlist in their designs. another important button is the load parameters button. ipexpress stores the parameters specified in a .lpc file. this file is generated along with the module. users can click on the load parameters but- ton to load the parameters of a previously generated module to re-visit or make changes to them. once the module is generated, users can either instantiate the *.lpc or the verilog-hdl/ vhdl file in top-level mod- ule of their design.
10-6 lattice semiconductor lattice xp2 memory usage guide the various memory modules, both ebr and distributed, are discussed in detail in this document. memory modules ecc is supported in most memories. if you choos e to use ecc, you will have a 2-bit error signal. ? when error[1:0]=00, there is no error. ? when error[0]=1, it indicates that there was a 1 bit error which was fixed. ? when error[1]=1, it indicates that there was a 2-bit error which cannot be corrected. single port ram (r am_dq) ? ebr based the ebr blocks in latticexp2 devices can be configured as single port ram or ram_dq. ipexpress allows users to generate the verilog-hdl or vhdl along edif netlis t for the memory size as per design requirements. ipexpress generates the memory module as shown in figure 10-5. figure 10-5. single port memory module generated by ipexpress since the device has a number of ebr blocks, the generated module makes use of these ebr blocks, or primi- tives, and cascades them to create the memory sizes specified by the user in the ipexpress gui. for memory sizes smaller than an ebr block, the module will be created in one ebr block. for memory sizes larger than one ebr block, multiple ebr blocks can be cascaded in depth or width (as required to create these sizes). in single port ram mode, the input data and address for the ports are registered at the input of the memory array. the output data of the memory is optionally registered at the output. the various ports and their definitions for the single port memory are listed in table 10-2. the table lists the corre- sponding ports for the module generated by ipexpress and for the ebr ram_dq primitive. ram_dq ebr-based single port memory clock clocken reset we address data q
10-7 lattice semiconductor lattice xp2 memory usage guide table 10-2. ebr-based single port memory port definitions reset (or rst) resets only the input and output registers of the ram. it does not reset the contents of the memory. chip select (cs) is a useful port in the ebr primitiv e when multiple cascaded ebr blocks are required by the memory. the cs signal forms the msb for the address when multiple ebr blocks are cascaded. cs is a 3-bit bus, so it can cascade eight memories easily. if the memory si ze specified by the user requires more than eight ebr blocks, the isplever software automatically generates the additional address decoding logic, which is imple- mented in the pfu (external to the ebr blocks). each ebr block consists of 18,432 bits of ram. the values for x (address) and y (data) for each ebr block for the devices are listed in table 10-3. table 10-3. single port memory sizes for 16k memories for latticexp2 table 10-4 shows the various attributes available for the single port memory (ram_dq). some of these attributes are user-selectable through the ipexpress gui. for detailed attribute definitions, refer to appendix a. port name in generated module port name in the ebr block primitive des cription active state clock clk clock rising clock edge clocken ce clock enable active high address ad[x:0] address bus ? data di[y:0] data in ? q do[y:0] data out ? we we write enable active high reset rst reset active high ? cs[2:0] chip select ? single port memory size input data outp ut data address [msb:lsb] 16k x 1 di do ad[13:0] 8k x 2 di[1:0] do[1:0] ad[12:0] 4k x 4 di[3:0] do[3:0] ad[11:0] 2k x 9 di[8:0] do[8:0] ad[10:0] 1k x 18 di[17:0] do[17:0] ad[9:0] 512 x 36 di[35:0] do[35:0] ad[8:0]
10-8 lattice semiconductor lattice xp2 memory usage guide table 10-4. single port ram attributes for latticexp2 the single port ram (ram_dq) can be configured as normal or write through modes. each of these modes affects the data coming out of port q of the memory during the write operation followed by the read opera- tion at the same memory location. additionally, users can select to enable the output registers for ram_dq. figures 10-6-10-9 show the internal tim- ing waveforms for the single port ram (ram_dq) with these options. attribute description values default value user selectable through ipexpress address depth address depth read port 16k, 8k, 4k, 2k, 1k, 512 yes data width data word width read port 1, 2, 4, 9, 18, 36 1 yes enable output registers register mode (pipelining) for write port noreg, outreg noreg yes enable gsr enables global set reset enable, disable enable yes reset mode selects the reset type async, sync async yes memory file format binary, hex, addressed hex yes write mode read / write mode for write port normal, write- through normal yes chip select decode chip select decode for read port 0b000, 0b001, 0b010, 0b011, 0b100, 0b101, 0b110, 0b111 0b000 no init value initialization value 0x000000000000000000000 00000000000000000000000 00000000000000000000000 0000000000000......0xffff fffffffffffffffffffff fffffffffffffffffffff fffffffffffffffffffff fffffffffffff 0x000000000 00000000000 00000000000 00000000000 00000000000 00000000000 00000000000 00000 no
10-9 lattice semiconductor lattice xp2 memory usage guide figure 10-6. single port ram timing waveform - normal mode, without output registers figure 10-7. single port ram timing waveform - normal mode, with output registers add_0 add_1 add_0 add_1 add_2 data_0 data_1 invalid data data_0 clock wren address data q clocken t suwren_ebr t hwren_ebr t suaddr_ebr t haddr_ebr t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr t co_ebr data_1 data_2 add_0 add_1 add_0 add_1 add_2 data_0 data_1 invalid data data_0 data_1 clock reset wren address data q clocken t suwren_ebr t hwren_ebr t suaddr_ebr t haddr_ebr t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr t coo_ebr
10-10 lattice semiconductor lattice xp2 memory usage guide figure 10-8. single port ram timing waveform - write through mode, without output registers figure 10-9. single port ram timing waveform - write through mode, with output registers add_0 add_1 add_0 data_0 data_1 data_2 data_3 data_4 invalid data data_1 clock wren address data q clocken t suwren_ebr t hwren_ebr t suaddr_ebr t haddr_ebr t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr t co_ebr data_2 data_0 data_3 data_4 add_0 add_1 add_0 data_0 data_1 data_2 data_3 data_4 invalid data data_1 clock wren address data q clocken t suwren_ebr t hwren_ebr t suaddr_ebr t haddr_ebr t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr t coo_ebr data_2 data_0 data_3 reset
10-11 lattice semiconductor lattice xp2 memory usage guide true dual port ram (r am_dp_true) ? ebr based the ebr blocks in the latticexp2 devices can be configured as true-dual port ram or ram_dp_true. ipex- press allows users to generate the verilog-hdl, vhdl or edif netlists for the memory size as per design require- ments. ipexpress generates the memory module as shown in figure 10-10. figure 10-10. true dual port memory module generated by ipexpress the generated module makes use of these ebr blocks or primitives. for memory sizes smaller than an ebr block, the module will be created in one ebr bl ock. when the specified memory is la rger than one ebr block, multiple ebr blocks can be cascaded in depth or width (as required to create these sizes). in true dual port ram mode, the input data and address for the ports are registered at the input of the memory array. the output data of the memory is optionally registered at the output. the various ports and their definitions for single port memory are listed in table 10-5. the table lists the corre- sponding ports for the module generated by ipexpress and for the ebr ram_dp_true primitive. table 10-5. ebr-based true dual port memory port definitions reset (or rst) resets only the input and output registers of the ram. it does not reset the contents of the memory. chip select (cs) is a useful port in the ebr primitiv e when multiple cascaded ebr blocks are required by the memory. the cs signal forms the msb for the address when multiple ebr blocks are cascaded. since cs is a 3- bit bus, it can cascade eight memories easily. however, if the memory size specified by the user requires more than eight ebr blocks, the isplever software automatically generates t he additional addre ss decoding logic, which is implemented in the pfu external to the ebr blocks. port name in generated module port name in the ebr block primitive description active state clocka, clockb clka, clkb clock for porta and portb rising clock edge clockena, clockenb cea, ceb clock enables for port clka and clkb active high addressa, addressb ada[x1:0], adb[x2 :0] address bus port a and port b ? dataa, datab dia[y1:0], dib[y2:0 ] input data port a and port b ? qa, qb doa[y1:0], dob[y2:0] output data port a and port b ? wra, wrb wea, web write enable port a and port b active high reseta, resetb rsta, rstb reset for port a and port b active high ? csa[2:0], csb[2: 0] chip selects for each port ? ram_dp_true ebr-based true dual port memory clocka clockena reseta wra addressa dataina qa clockb clockenb resetb wrb addressb datainb qb
10-12 lattice semiconductor lattice xp2 memory usage guide each ebr block consists of 18,432 bits of ram. the values for x?s (for address) and y?s (data) for each ebr block for the devices are listed in table 10-6. table 10-6. true dual port memory sizes for 16k memory for latticexp2 table 10-7 shows the various attributes available for the single port memory (ram_dq). some of these attributes are user-selectable through the ipexpress gui. for detailed attribute definitions, refer to the appendix a. table 10-7. true dual port ram attributes for latticexp2 dual port memory size input data port a input data port b output data port a output data port b address port a [msb:lsb] address port b [msb:lsb] 16k x 1 dia dib doa dob ada[13:0] adb[13:0] 8k x 2 dia[1:0] dib[1:0] doa[1:0 ] dob[1:0] ada[12:0] adb[12:0] 4k x 4 dia[3:0] dib[3:0] doa[3:0 ] dob[3:0] ada[11:0] adb[11:0] 2k x 9 dia[8:0] dib[8:0] doa[8:0 ] dob[8:0] ada[10:0] adb[10:0] 1k x 18 dia[17:0] dib[17:0] doa[ 17:0] dob[17:0] ada[9:0] adb[9:0] attribute description values default value user selectable through ipexpress port a address depth address depth port a 16k, 8k, 4k, 2k, 1k yes port a data width data word width port a 1, 2, 4, 9, 18 1 yes port b address depth address depth port b 16k, 8k, 4k, 2k, 1k yes port b data width data word width port b 1, 2, 4, 9, 18 1 yes port a enable output registers register mode (pipelining) for port a noreg, outreg noreg yes port b enable output registers register mode (pipelining) for port b noreg, outreg noreg yes enable gsr enables global set reset enable, disable enable yes reset mode selects the reset type async, sync async yes memory file format binary, hex, addressed hex yes port a write mode read / write mode for port a normal, write- through normal yes port b write mode read / write mode for port b normal, write- through normal yes chip select decode for port a chip select decode for port a 0b000, 0b001, 0b010, 0b011, 0b100, 0b101, 0b110, 0b111 0b000 no chip select decode for port b chip select decode for port b 0b000, 0b001, 0b010, 0b011, 0b100, 0b101, 0b110, 0b111 0b000 no init value initialization value 0x00000000000000000000 0000000000000000000000 0000000000000000000000 0000000000000000......0xf ffffffffffffffffffff ffffffffffffffffffff ffffffffffffffffffff fffffffffffffffffff 0x000000000 00000000000 00000000000 00000000000 00000000000 00000000000 00000000000 00000 no
10-13 lattice semiconductor lattice xp2 memory usage guide the true dual port ram (ram_dp_true) can be configured as normal or write through modes. each of these modes affects what data comes out of the port q of the memory during the write operation followed by the read operation at the same memory location. the detailed discussions of the write modes and the constraints of the true dual port can be found in appendix a. additionally, users can select to enable the output registers for ram_dp_true. figures 10-11 through 10-14 show the internal timing waveforms for the true dual port ram (ram_dp_true) with these options. figure 10-11. true dual port ram timing waveform - normal mode, without output registers add_a0 add_a1 add_a0 add_a1 add_a2 data_a0 data_a1 invalid data data_a0 clocka wrena addressa dataa qa clockena t suwren_ebr t hwren_ebr t suaddr_ebr t haddr_ebr t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr t co_ebr data_a1 data_a2 add_b0 add_b1 add_b0 add_b1 add_b2 data_b0 data_b1 invalid data data_b0 clockb wrenb addressb datab qb clockenb t suwren_ebr t hwren_ebr t suaddr_ebr t haddr_ebr t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr t co_ebr data_b1 data_b2
10-14 lattice semiconductor lattice xp2 memory usage guide figure 10-12. true dual port ram timing waveform - normal mode with output registers add_a0 add_a1 add_a0 add_a1 add_a2 data_a0 data_a1 clocka wrena addressa dataa qa clockena t suwren_ebr t hwren_ebr t suaddr_ebr t haddr_ebr t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr add_b0 add_b1 add_b0 add_b1 add_b2 data_b0 data_b1 invalid data data_b0 clockb wrenb addressb datab qb clockenb t suwren_ebr t hwren_ebr t suaddr_ebr t haddr_ebr t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr t coo_ebr data_b1 invalid data data_a0 t coo_ebr data_a1 reset
10-15 lattice semiconductor lattice xp2 memory usage guide figure 10-13. true dual port ram timing wavefo rm - write through mode, without output registers add_a0 add_a1 add_a0 data_a0 data_a1 data_a2 data_a3 data_a4 invalid data data_a1 clocka wrena addressa dataa qa clockena t suwren_ebr t hwren_ebr t suaddr_ebr t haddr_ebr t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr t co_ebr data_a2 data_a0 data_a3 data_a4 add_b0 add_b1 add_b0 data_b0 data_b1 data_b2 data_b3 data_b4 invalid data data_b1 clockb wrenb addressb datab qb clockenb t suwren_ebr t hwren_ebr t suaddr_ebr t haddr_ebr t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr t co_ebr data_b2 data_b0 data_b3 data_b4
10-16 lattice semiconductor lattice xp2 memory usage guide figure 10-14. true dual port ram timing wavefo rm - write through mode, with output registers add_0 add_1 add_0 data_0 data_1 data_2 data_3 data_4 invalid data data_1 clocka wrena addressa dataa qa clockena t suwren_ebr t hwren_ebr t suaddr_ebr t haddr_ebr t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr t coo_ebr data_2 data_0 data_3 add_0 add_1 add_0 data_0 data_1 data_2 data_3 data_4 invalid data data_1 clockb wrenb addressb datab qb clockenb t suwren_ebr t hwren_ebr t suaddr_ebr t haddr_ebr t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr t coo_ebr data_2 data_0 data_3 reset
10-17 lattice semiconductor lattice xp2 memory usage guide pseudo dual port ram (ram_dp) ? ebr based the ebr blocks in latticexp2 devices can be configured as pseudo-dual port ram or ram_dp. ipexpress allows users to generate the verilog-hdl or vhdl along with edif netlists for the memory size as per design require- ments. ipexpress generates the memory module as shown in figure 10-15. figure 10-15. pseudo dual port memory module generated by ipexpress the generated module makes use of these ebr blocks or primitives. for memory sizes smaller than an ebr block, the module will be created in one ebr bloc k. if the specified memory is larger than one ebr block, multiple ebr blocks can be cascaded in depth or width (as required to create these sizes). in pseudo dual port ram mode, the input data and address for the ports are registered at the input of the memory array. the output data of the memory is optionally registered at the output. the various ports and their definitions for the single port memory are listed in table 10-8. the table lists the corre- sponding ports for the module generated by ipexpress and for the ebr ram_dp primitive. table 10-8. ebr-based pseudo-dual port memory port definitions reset (rst) resets only the input and output registers of the ram. it does not reset the contents of the memory. chip select (cs) is a useful port when multiple cascaded ebr blocks are required by the memory. the cs signal forms the msb for the address when multiple ebr blocks are cascaded. since cs is a 3-bit bus, it can cascade eight memories easily. however, if the memory size specifie d by the user requires more than eight ebr blocks, the isplever software automatically generates the additional address decoding logic, which is implemented in the pfu external to the ebr blocks. port name in generated module port name in the ebr block primitive des cription active state rdaddress adr[x1:0] read address ? wraddress adw[x2:0] write address ? rdclock clkr read clock rising clock edge wrclock clkw write clock rising clock edge rdclocken cer read clock enable active high wrclocken cew write clock enable active high q do[y1:0] read data ? data di[y2:0] write data ? we we write enable active high reset rst reset active high ? cs[2:0] chip select ? ram_dp ebr based pseudo dual port memory wrclock wrclocken reset we wraddress data rdclock rdclocken rdaddress q
10-18 lattice semiconductor lattice xp2 memory usage guide each ebr block consists of 18,432 bits of ram. the values for x?s (for address) and y?s (data) for each ebr block for the devices are as in table 10-9. table 10-9. pseudo-dual port memory sizes for 16k memory for latticexp2 table 10-10 shows the various attributes available for the pseudo-dual port memory (ram_dp). some of these attributes are user-selectable through the ipexpress gui. for detailed attribute definitions, refer to appendix a. table 10-10. pseudo-dual port ram attributes for latticexp2 pseudo-dual port memory size input data port a input data port b output data port a output data port b read address port a [msb:lsb] write address port b [msb:lsb] 16k x 1 dia dib doa dob rad[13:0] wad[13:0] 8k x 2 dia[1:0] dib[1:0] doa[1:0 ] dob[1:0] rad[12:0] wad[12:0] 4k x 4 dia[3:0] dib[3:0] doa[3:0 ] dob[3:0] rad[11:0] wad[11:0] 2k x 9 dia[8:0] dib[8:0] doa[8:0 ] dob[8:0] rad[10:0] wad[10:0] 1k x 18 dia[17:0] dib[17:0] doa[ 17:0] dob[17:0] ra d[9:0] wad[9:0] 512 x 36 dia[35:0] dib[35:0] doa[35 :0] dob[35:0] ra d[8:0] wad[8:0] attribute description values default value user selectable through ipexpress read port address depth address depth read port 16k, 8k, 4k, 2k, 1k, 512 yes read port data width data word width read port 1, 2, 4, 9, 18, 36 1 yes write port address depth address depth write port 16k, 8k, 4k, 2k, 1k yes write port data width data word width write port 1, 2, 4, 9, 18, 36 1 yes write port enable out- put registers register mode (pipelining) for write port noreg, outreg noreg yes enable gsr enables global set reset enable, disable enable yes reset mode selects the reset type async, sync async yes memory file format binary, hex, addressed hex yes read port write mode read / write mode for read port normal normal yes write port write mode read / write mode for write port normal normal yes chip select decode for read port chip select decode for read port 0b000, 0b001, 0b010, 0b011, 0b100, 0b101, 0b110, 0b111 0b000 no chip select decode for write port chip select decode for write port 0b000, 0b001, 0b010, 0b011, 0b100, 0b101, 0b110, 0b111 0b000 no init value initialization value 0x0000000000000000000000000 000000000000000000000000000 000000000000000000000000000 0......0xfffffffffffffffffff ffffffffffffffffffffffff ffffffffffffffffffffffff fffffffffffff 0x000000000000 00000000000000 00000000000000 00000000000000 00000000000000 000000000000 no
10-19 lattice semiconductor lattice xp2 memory usage guide users have the option to enable the output registers for pseudo-dual port ram (ram_dp). figures 10-16 and 10- 17 show the internal timing waveforms for pseudo-dual port ram (ram_dp) with these options. figure 10-16. pseudo dual port ram ti ming diagram - withou t output registers data_0 data_1 data_2 invalid data data_0 wrclock data q wrclocken t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr t co_ebr data_1 dat a_2 add_0 add_1 add_2 rdaddress t suaddr_ebr t haddr_ebr rdclock rdclocken t suce_ebr t hce_ebr add_0 add_1 add_2 wraddress t suaddr_ebr t haddr_ebr
10-20 lattice semiconductor lattice xp2 memory usage guide figure 10-17. pseudo dual port ram ti ming diagram - with output registers read only memory (rom) - ebr based the ebr blocks in the latticexp2 devices can be configured as read only memory or rom. ipexpress allows users to generate the verilog-hdl or vhdl and the edif netlist for the memory size, as per design requirements. users are required to provide the rom memory content in the form of an initialization file. ipexpress generates the memory module as shown in figure 10-18. figure 10-18. read-only memory module generated by ipexpress the generated module makes use of these ebr blocks or primitives. for memory sizes smaller than an ebr block, the module will be created in one ebr bloc k. if the specified memory is larger than one ebr block, multiple ebr blocks can be cascaded, in depth or width (as required to create these sizes). in rom mode, the address for the port is registered at the input of the memory array. the output data of the mem- ory is optionally registered at the output. data_0 data_1 data_2 invalid data data_0 wrclock data q wrclocken t sudata_ebr t hdata_ebr t suce_ebr t hce_ebr t coo_ebr dat a_1 add_0 add_1 add_2 rdaddress t suaddr_ebr t haddr_ebr rdclock rdclocken t suce_ebr t hce_ebr add_0 add_1 add_2 wraddress t suaddr_ebr t haddr_ebr rom ebr based read only memory outclock outclocken reset address q
10-21 lattice semiconductor lattice xp2 memory usage guide the various ports and their definitions for the rom are listed in table 10-11. the table lists the corresponding ports for the module generated by ipexpress and for the rom primitive. table 10-11. ebr-based rom port definitions reset (rst) resets only the input and output registers of the ram. it does not reset the contents of the memory. chip select (cs) is a useful port when multiple cascaded ebr blocks are required by the memory. the cs signal forms the msb for the address when multiple ebr blocks are cascaded. since cs is a 3-bit bus, it can cascade eight memories easily. however, if the memory size specifie d by the user requires more than eight ebr blocks, the isplever software automatically generates the additional address decoding logic, which is implemented in the pfu external to the ebr blocks. while generating the rom using ipexpress, the user must pr ovide the initialization file to pre-initialize the contents of the rom. these files are the *.mem files and they can be of binary, hex or the addressed hex formats. the ini- tialization files are discussed in detail in the initializing memory sect ion of this document. users have the option of enabling the output registers for read only memory (rom). figures 10-19 and 10-20 show the internal timing waveforms for the read only memory (rom) with these options. each ebr block consists of 18,432 bits of ram. the values for x?s (for address) and y?s (data) for each ebr block for the devices are as per table 10-12. table 10-12. rom memory sizes for 16k memory for latticexp2 table 10-13 shows the various attributes available for the read only memory (rom). some of these attributes are user-selectable through the ipexpress gui. for detailed attribute definitions, refer to appendix a. port name in generated module port name in the ebr block primitive description active state address ad[x:0] read address ? outclock clk clock rising clock edge outclocken ce clock enable active high reset rst reset active high ? cs[2:0] chip select ? rom output data address port [msb:lsb] 16k x 1 doa wad[13:0] 8k x 2 doa[1:0] wad[12:0] 4k x 4 doa[3:0] wad[11:0] 2k x 9 doa[8:0] wad[10:0] 1k x 18 doa[17:0] wad[9:0] 512 x 36 doa[35:0] wad[8:0]
10-22 lattice semiconductor lattice xp2 memory usage guide table 10-13. pseudo-dual port ram attributes for latticexp2 figure 10-19. rom timing waveform - without output registers figure 10-20. rom timing waveform - with output registers attribute description values default value user selectable through ipexpress address depth address depth read port 16k, 8k, 4k, 2k, 1k, 512 yes data width data word width read port 1, 2, 4, 9, 18, 36 1 yes enable output registers register mode (pi pelining) for write port noreg, outreg noreg yes enable gsr enables global se t reset enable, disable enable yes reset mode selects the re set type async, sync async yes memory file format binary, hex, addressed hex yes chip select decode chip select decode for read port 0b000, 0b001, 0b010, 0b011, 0b100, 0b101, 0b110, 0b111 0b000 no add_0 add_1 add_2 add_3 add_4 invalid data data_0 outclock address q outclocken t suaddr_ebr t haddr_ebr t suce_ebr t hce_ebr t co_ebr data_1 data_2 data_3 data_4 add_0 add_1 add_2 add_3 add_4 invalid data data_0 outclock address q outclocken t suaddr_ebr t haddr_ebr t suce_ebr t hce_ebr t coo_ebr data_1 data_2 data_3
10-23 lattice semiconductor lattice xp2 memory usage guide first in first out (fifo, fifo_dc) ? ebr based fifos are not supported in certain devices such as the latticeecp/ec, latticeecp2/m, latticexp and machxo. the hardware has embedded block ram (ebr) which can be configured in single port (ram_dq), pseudo-dual port (ram_dp) and true dual port (ram_dp_true) ra ms. the fifos in these devices can be emulated fifos that are built around these ra ms. the ipexpress point tool in the isplever design softwar e allows users to build a fifo and fifo_dc around pseudo dual port ram (or dp_ram). each of these fifos can be configured with (pipelined) and without (non-pipelined) output registers. in the pipe- lined mode users have an extra option to enable the outp ut registers by the rden si gnal. we will discuss the oper- ation in the following sections. let us take a look at the operation of these fifos. first in first out (fifo) memory the fifo, or the single clock fifo, is an emulated fifo. the address logic and the flag logic is implemented in the fpga fabric around the ram. the ports available on the fifo are: ? reset ?clock ?wren ?rden ?data ?q ? full flag ? almost full flag ? empty flag ? almost empty flag let us first discuss the non-pipelined or the fifo without output registers. figure 10-21 shows the operation of the fifo when it is empty and the data starts to get written into it.
10-24 lattice semiconductor lattice xp2 memory usage guide figure 10-21. fifo without output re gisters, start of data write cycle the wren signal must be high to start writing into the fifo. the empty and almost empty flags are high to begin and full and almost full are low. when the first data is written into the fifo, the empty flag de-asserts (or goes low), as the fifo is no longer empty. in this figure we assume that the almost empty setting flag setting is 3 (address location 3). so the almost empty flag gets de-asserted when the third address location is filled. now let us assume that we cont inue to write into the fifo to fill it. when the fifo is f illed, the almost full and full flags are asserted. figure 10-22 shows the behavior of these flags. in this figure we assume that fifo depth is 'n'. figure 10-22. fifo without output registers, end of data write cycle in this case, the almost full flag is in the 2 location before the fifo is filled. the almost full flag is asserted when the n-2 location is written, and the full flag is a sserted when the last word is written into the fifo. data_1 invalid data data_2 data_3 data_4 data_5 clock reset wren rden data empty almost empty full almost full invalid q q data_n-2 data_n-1 data_n data_x clock reset wren rden data empty almost empty full almost full invalid q q data_x
10-25 lattice semiconductor lattice xp2 memory usage guide data_x data inputs do not get written as the fifo is full (the full flag is high). now let us look at the waveforms when the contents of the fifo are read out. figure 10-23 shows the start of the read cycle. rden goes high and the data read starts. the full and almost full flags are de-asserted, as shown. figure 10-23. fifo without output registers, start of data read cycle similarly, as the data is read out and fifo is emptied, the almost empty and empty flags are asserted. figure 10-24. fifo without output registers, end of data read cycle figures 10-21 to 10-24 show the behavior of non-pipelined fifo or fifo without output registers. when we pipe- line the registers, the output data is delayed by one clock cycle. there is also the extra option for output registers to be enabled by the rden signal. data_1 invalid data data_2 data_3 data_4 data_5 clock reset wren rden data empty almost empty full almost full invalid data q data_n-3 data_n-2 data_n-1 data_n clock reset wren rden data empty almost empty full almost full invalid data q data_n-4
10-26 lattice semiconductor lattice xp2 memory usage guide figures 10-25 to 10-28 show the similar waveforms for the fifo with output register and with output register enable with rden. it should be noted that flags are asserted and de-asserted with similar timing to the fifo without output registers. however, it is only the data out 'q' that is delayed by one clock cycle. figure 10-25. fifo with output registers, start of data write cycle figure 10-26. fifo with output registers, end of data write cycle data_1 invalid data data_2 data_3 data_4 data_5 clock reset wren rden data empty almost empty full almost full invalid q q data_n-2 data_n-1 data_n data_x clock reset wren rden data empty almost empty full almost full invalid q q data_x
10-27 lattice semiconductor lattice xp2 memory usage guide figure 10-27. fifo with output registers, start of data read cycle figure 10-28. fifo with output registers, end of data read cycle and finally, if you select the option enab le output register with rden, it still delays the data out by one clock cycle (as compared to the non-pipelined fifo). the rden should also be high during that clock cycle, otherwise the data takes an extra clock cycle when the rden goes true. data_1 invalid data data_2 data_3 data_4 clock reset wren rden data empty almost empty full almost full invalid data q data_n-4 data_n-3 data_n-2 data_n-1 data_n clock reset wren rden data empty almost empty full almost full invalid data q data_n-5
10-28 lattice semiconductor lattice xp2 memory usage guide figure 10-29. fifo with output registers and rden on output registers dual clock first in first out (fifo_dc) memory: the fifo_dc or the dual clock fifo is also an emulated fifo. again, the address logic and the flag logic is imple- mented in the fpga fabric around the ram. the ports available on the fifo_dc are: ? reset ? rpreset ? wrclock ?rdclock ?wren ?rden ?data ?q ? full flag ? almost full flag ? empty flag ? almost empty flag fifo_dc flags the fifo_dc, as an emulated fifo, required the flags to be implemented in the fpga logic around the block ram. because of the two clocks, the flags were required to change clock domains from read clock to write clock and vice versa. this adds latency to the flags either dur ing assertion or de-assertion. the latency can be avoided only in one of the cases (either assertion or de-assertion) or distributed among these cases. in the current emulated fifo_dc, there is no latency during assertion of these flags which we feel is more impor- tant. thus, when these flags are required to go true, there is no latency. however, due to the design of the flag logic running on two clock domains, there is latency during the de-assertion. data_1 invalid data data_2 data_3 data_4 data_5 clock reset wren rden data empty almost empty full almost full q data_1 invalid data data_2
10-29 lattice semiconductor lattice xp2 memory usage guide let us assume that we start to write into the fifo _dc to fill it. the write operatio n is controlled by wrclock and wren, however it takes extra rdclock cycles for de-assertion of the empty and almost empty flags. on the other hand, de-assertion of full and almost full result in the reading out of the data from the fifo_dc. it takes extra wrclock cycles, after reading this data, for the flags to come out. with this in mind, let us look at the fifo_dc without output registers waveforms. figure 10-30 shows the operation of the fifo_dc when it is empty and the data starts to be written into it. figure 10-30. fifo_dc without output registers, start of data write cycle the wren signal must be high to start writing into the fifo_dc. the empty and almost empty flags are high to begin and full and almost full are low. when the first data is written into the fifo_dc, the empty flag de-asserts (or goes low), as the fifo_dc is no lon- ger empty. in this figure we assume that the almost empty setting flag setting is 3 (address location 3). so the almost empty flag is de-asserted when the third address location is filled. now let us assume that we continue to write into the fifo_dc to fill it. when the fifo_dc is fille d, the almost full and full flags are asserted. figure 10-31 shows the behavior of these flags. in this figure the fifo_dc depth is 'n'. data_1 invalid data data_2 data_3 data_4 data_5 wrclock reset wren rden data empty almost empty full almost full invalid q q rdclock rpreset
10-30 lattice semiconductor lattice xp2 memory usage guide figure 10-31. fifo_dc without output registers, end of data write cycle in this case, the almost full flag is in the 2 location be fore the fifo_dc is filled. th e almost full flag is asserted when the n-2 location is written, and the full flag is asserted when the last word is written into the fifo_dc. data_x data inputs do not get written as the fifo_dc is full (the full flag is high). note that the assertion of these flags is immediate and there is no latency when they go true. now let us look at the waveforms when the contents of the fifo_dc are read out. figure 10-32 shows the start of the read cycle. rden goes high and the data read starts. the full and almost full flags are de-asserted, as shown. in this case, note that the de-assertion is delayed by two clock cycles. wrclock reset empty almost empty full almost full invalid q q rdclock rpreset data_n-2 data_n-1 data_n data_x data_x wren rden data
10-31 lattice semiconductor lattice xp2 memory usage guide figure 10-32. fifo_dc without output registers, start of data read cycle similarly, as the data is read out, and fifo_dc is emptied, the almost empty and empty flags are asserted. figure 10-33. fifo_dc without output registers, end of data read cycle wrclock reset empty almost empty full almost full invalid data q rdclock rpreset data_1 data_2 invalid q wren rden data data_3 data_6 data_5 data_4 wrclock reset empty almost empty full almost full invalid data q rdclock rpreset wren rden data data_n-2 data_n-1 data_n data_n data_n-3
10-32 lattice semiconductor lattice xp2 memory usage guide figure 10-33 show the behavior of non-pipelined fifo_dc or fifo_dc without output registers. when we pipeline the registers, the output data is delayed by one clock cycle. there is an extra option for the output registers to be enabled by the rden signal. figures 10-34 to 10-37 show the similar waveforms for the fifo_dc with output register and without output regis- ter enable with rden. note that flags are asserted and de-asserted with similar timing to the fifo_dc without out- put registers. however, it is only the data out 'q' that is delayed by one clock cycle. figure 10-34. fifo_dc with output registers, start of data write cycle data_1 invalid data data_2 data_3 data_4 data_5 wrclock reset wren rden data empty almost empty full almost full invalid q q rdclock rpreset
10-33 lattice semiconductor lattice xp2 memory usage guide figure 10-35. fifo_dc with output registers, end of data write cycle figure 10-36. fifo_dc with output registers, start of data read cycle wrclock reset empty almost empty full almost full invalid q q rdclock rpreset data_n-2 data_n-1 data_n invalid data invalid data wren rden data wrclock reset empty almost empty full almost full invalid data q rdclock rpreset data_1 invalid q wren rden data data_2 data_5 data_4 data_3
10-34 lattice semiconductor lattice xp2 memory usage guide figure 10-37. fifo_dc with output registers, end of data read cycle and finally, if you select the option to en able the output register with rden, it still delays the data out by one clock cycle (as compared to the non -pipelined fifo_dc). the rd en should also be high during that clock cycle, other- wise the data takes an extra clock cycle when the rden is goes true. figure 10-38. fifo_dc with output registers and rden on output registers wrclock reset empty almost empty full almost full invalid data q rdclock rpreset wren rden data data_n-3 data_n-2 data_1 data_n data_n-4 wrclock reset empty almost empty full almost full invalid data q rdclock rpreset invalid q wren rden data data_3 data_2 data_1
10-35 lattice semiconductor lattice xp2 memory usage guide distributed single port ram (d istributed_spram ) ? pfu based pfu-based distributed single port ram is created using the 4-input lut (look-up table) available in the pfu. these luts can be cascaded to create larger distributed memory sizes. figure 10-39 shows the distributed single port ram module as generated by ipexpress. figure 10-39. distributed single port ram module generated by ipexpress the generated module makes use 4-input lut available in the pfu. additional logic like clock, reset is generated by utilizing the resources available in the pfu. ports such as read clock (rdclock) and read clock enable (rdclocken), are not available in the hardware prim- itive. these are generated by ipexpress when the user wants the to enable the output registers in their ipexpress configuration. the various ports and their definitions for the memory ar e as per table 10-14. the table lists the corresponding ports for the module generated by ipexpress and for the primitive. table 10-14. pfu-based distributed single port ram port definitions ports such as clock enable (clocken) are not available in the hardware primitive. these are generated by ipex- press when the user wishes to enable the output registers in the ipexpress configuration. users have the option of enabling the output registers for distributed single port ram (distributed_spram). fig- ures 10-40 and 10-41 show the internal timing waveforms for the distributed single port ram (distributed_spram) with these options. port name in generated module port name in the pfu primitive description active state clock ck clock rising clock edge clocken ? clock enable active high reset ? reset active high we wre write enable active high address ad[3:0] address ? data di[1:0] data in ? q do[1:0] data out ? pfu based distributed single port memory clock clocken reset we address q data
10-36 lattice semiconductor lattice xp2 memory usage guide figure 10-40. pfu based distri buted single port ram timing waveform - without output registers figure 10-41. pfu based distri buted single port ram timing waveform - with output registers add_0 add_1 add_0 add_1 add_2 data_0 data_1 invalid data data_0 clock we t t t t t t t address data q clocken hwren_pfu suaddr_pfu haddr_pfu sudata_pfu hdata_pfu coram_pfu data_1 suwren_pfu data_2 add_0 add_1 add_0 add_1 add_2 data_0 data_1 invalid data data_0 clock we address data q clocken hwren_pfu suaddr_pfu haddr_pfu sudata_pfu hdata_pfu co suwren_pfu reset data_1 data_2 t t t t t t t
10-37 lattice semiconductor lattice xp2 memory usage guide distributed dual port ram (distributed_dpram) ? pfu based pfu-based distributed dual port ram is also created using the 4-input lut (look-up table) available in the pfu. these luts can be cascaded to create a larger distributed memory sizes. figure 10-42. distributed dual port ram module generated by ipexpress the generated module makes use of the 4-input lut available in the pfu. additional logic like clock and reset is generated by utilizing the res ources available in the pfu. ports such as read clock (rdclock) and read clock enable (rdclocken), are not available in the hardware prim- itive. these are generated by ipexpress when the user wants the to enable the output registers in the ipexpress configuration. the various ports and their definitions for memory are as per table 10-15. the table lists the corresponding ports for the module generated by ipexpress and for the primitive. table 10-15. pfu-based distributed dual-port ram port definitions ports such as read clock (rdclock) and read clock enab le (rdclocken) are not ava ilable in the hardware primi- tive. these are generated by ipexpress when the user wants to enable the output registers in the ipexpress config- uration. port name in generated module port name in the ebr block primitive description active state wraddress wad[3:0] write address ? rdaddress rad[3:0] read address ? rdclock ? read clock rising clock edge rdclocken ? read clock enable active high wrclock wck write clock rising clock edge wrclocken ? write clock enable active high we wre write enable active high data di[1:0] data input ? q rdo[1:0] data out ? pfu based distributed dual port memory wraddress rdaddress rdclock rdclocken reset q we wrclock wrclocken data
10-38 lattice semiconductor lattice xp2 memory usage guide users have the option of enabling the output registers for distributed dual port ram (distributed_dpram). fig- ures 10-43 and 10-44 show the internal timing waveforms for the distributed dual port ram (distributed_dpram) with these options. figure 10-43. pfu based distributed dual port ram timing waveform - without output registers data_0 data_1 data_2 invalid data wrclock data q wrclocken sudata_ebr hdata_ebr coram_pfu suce_ebr hce_ebr rdaddress add_0 add_1 add_2 wraddress suaddr_ebr haddr_ebr we add_0 add_1 add_2 data_0 t t t t t t t data_1 data_2
10-39 lattice semiconductor lattice xp2 memory usage guide figure 10-44. pfu based distributed dual port ram timing waveform - with output registers distributed rom (distr ibuted_rom) ? pfu based pfu-based distributed rom is also created using the 4-input lut (look-up table) available in the pfu. these luts can be cascaded to create larger distributed memory sizes. figure 10-45 shows the distributed rom module as generated by ipexpress. figure 10-45. distributed rom generated by ipexpress the generated module makes use of the 4-input lut available in the pfu. additional logic like clock and reset is generated by utilizing the res ources available in the pfu. data_0 data_1 invalid data data_0 wrclock t t t t t t t t t t t data q wrclocken sudata_pfu hdata_pfu suwren_pfu hwren_pfu coram_pfu data_1 add_0 add_1 rdaddress rdclock rdclocken suce_pfu hce_pfu add_0 add_1 wraddress suaddr_pfu haddr_pfu reset we suwren_pfu hwren_pfu pfu-based distributed rom address outclock outclocken reset q
10-40 lattice semiconductor lattice xp2 memory usage guide ports such as out clock (outclock) and out clock enable (outclocken) are not available in the hardware primi- tive. these are generated by ipexpress when the user wants to enable the output registers in the ipexpress config- uration. the various ports and their definitions for memory are as per table 10-16. the table lists the corresponding ports for the module generated by ipexpress and for the primitive. table 10-16. pfu-based distributed rom port definitions users have the option to enable the output registers for distributed rom (distributed_rom). figures 10-46 and 10-47 show the internal timing waveforms for the distributed rom with these options. figure 10-46. pfu based rom timing waveform ? without output registers figure 10-47. pfu based rom timing waveform ? with output registers port name in generated module port name in the pfu block primitive description active state address ad[3:0] address ? outclock ? out clock rising clock edge outclocken ? out clock enable active high reset ? reset active high q do data out ? add_0 add_1 add_2 invalid data data_0 address tt t q suaddr_pfu haddr_pfu coram_pfu data_1 data_2 add_0 add_1 add_2 invalid data data_0 outclock address q tt outclocken suaddr_pfu haddr_pfu data_1 reset coram_pfu
10-41 lattice semiconductor lattice xp2 memory usage guide user tag memory the tag memory is an area on the on-chip flash which can be used for non-volatile storage. it is accessed in your design as if it were an external spi flash. both spi bus operation modes 0 (0,0) and 3 (1,1) are supported. figure 10-48. sspia primitive table 10-17. user tag memory signal description basic specifications for tag memory there is one full page of tag memory in each latticexp2 device. page size ranges from 56 to 451 bytes. table 10-18. tag memory density primitive port name description si data input so data output clk clock cs chip select device tag memory (bits) tag memor y (bytes) xp2-5 632 79 xp2-8 768 96 xp2-17 2184 273 xp2-30 2640 330 xp2-40 3384 423 sspia si clk cs so
10-42 lattice semiconductor lattice xp2 memory usage guide table 10-19. timing specifications figure 10-49. generic timing diagram programming via t he spi interface since the sspia module is an internal module, i/os can be treated as i/os of any other soft module. therefore, they can be routed to other internal modules, or they can go out to i/o pads. the recommended routing is to the sysconfig port pins. table 10-20. usage of commands symbol parameter min max units f maxspi slave spi cclk clock frequency 25 mhz t rf clock and data input rise and fall time 20 ns t cscclk slave spi cclk clock high time 20 ns t socdo slave spi cclk clock low time 20 ns t scs csspin high time 25 ns t scss csspin setup time 25 ns t scsh csspin hold time 25 ns t stsu slave spi data in setup time 5 ns t sth slave spi data in hold time 5 ns t stvo slave spi output valid (after write_en) 20 ns slave spi output valid (without write_en)(1) 3 20 s t stco slave spi output hold time 0 ns t sdis slave spi output disable time 100 ns note: if the read_tag command is issued without first loading the write_en command, the device will need extra time, up to 20s maximum, to transfer the data from tag flash to the data-shift register. command name opcode bytes 1-3 1, 2 data delay time description read_tag 0x4e dummy out 3s min. read tag memory program_tag 0x8e dummy in 1ms min., 25ms max. program tag memory erase_tag 0x0e dummy 100ms min., 1000ms max. erase tag memory 1. data bytes are shifted with most significant bit first. 2. byte 1-3 are dummy clocks to provide extra timing for the de vice to execute the command. the data presented at the si pin during these dummy clocks can be any value and do not have to be 0x00 as shown. t scs 0 command 7 8 3-byte dummy 31 32 byte bounded data out (n-1) th csspisn cclk sispi so hi-z data shifting clocks 8 command shifting clocks 0 1 2 n-1 t scss t stvo t stsu t sth t stco t sdis t scsh hi-z t stsu t socdo t csclk
10-43 lattice semiconductor lattice xp2 memory usage guide general description the latticexp2 family of devices is designed with instant-on, standalone tag memory that is always available. tag memory is organized as a one-page flash non-volatile memory accessible by the hardwired serial peripheral interface port or the jtag port. the standalone tag memory is ideal for use as scratch pad memory for critical data, board serialization, board revision logs and programmed pattern identification. the integration of tag memory into the latticexp2 device family saves chip count and board space. it also can be used to replace obsoleted low-density spi eeprom devices. the hardwired spi interface does not require the device to pre-program the configuration flash first to enable the spi interface. the interface is already enabled when the device is shipped from lattice, saving board test time. the hard-wired spi interface allows the tag memory to retain its independent identity or accessible always in spite of the tag memory flash is embedded into the latticexp2 devices. the hard-wired spi interface is also important for field upgrades so that critical data can be maintained on the tag memory and guaranteed to be accessible even if the device is field upgraded to a new pattern. the instant-on capability is achieved by enabling the spi interface when the devices are shipped from lattice. unlike the configuration flash, the security setting of the device, standard or advanced, has no effect on the acces- sibility of the tag memory. therefore, the tag memory is always accessible. the tag memory, same as other flash fuses, can also be programmed using the ieee 1532 compliant program- ming flow on the jtag port for production programming support or for system debugging. pin descriptions the pins described below are not dedicated pins. if the tag memory feature is not required, these pins can be reg- ular user i/o pins. if the tag memory feature is required, the tag memory can be accessed by the internal spi interface through the core. the internal spi interface makes the tag memory capable of supporting advanced applications. for example: 1. use an i 2 c to spi translator to convert the spi tag memory to be an i 2 c tag memory device. 2. route the four spi interfaces to the other four user i/os. selections are made using the isplever design tool. by default, the extern al spi interface is enabled and tag memory is selected. the functional descriptions of the pins below are applicable to both the internal and external spi interfaces. serial data input (si) the spi serial data input pin provides a means for commands and data to be serially written to (shifted into) the device. data is latched on the falling ed ge of the serial clock (clk) input pin. serial data output (so) the spi serial data output pin provides a means for status and data to be serially read out (shifted out of) the device. data is shifted out on the falling edge of the serial clock (clk) input pin. serial clock (clk) the spi serial clock input pin provides the timing for serial input and output operations. chip select (cs) the spi chip select pin enables and disables spi interfac e operations. when the chip select is high the spi inter- face is deselected and the serial data output (so) pin is at high impedance. when it is brought low, the spi inter-
10-44 lattice semiconductor lattice xp2 memory usage guide face is selected and commands can be written into and data read from the device. after power up, cs must transit from high to low before a new command can be accepted. spi operations spi modes the spi interface is accessible through the spi-compatible bus consisting of four signals: serial clock (clk), chip select (cs), serial data input (si) and serial data output (so). both spi bus operation modes 0 (0,0) and 3 (1,1) are supported. the primary difference between mode 0 and mode 3 concerns the normal state of the clk pin when the spi master is in standby and data is not being transferred to the device?s spi interface. for mode 0 the clk is normally low and for mode 3 the clk signal is normally high. in either case, data input on the si pin is sam- pled only during the rising edge. da ta output on the so pin is clocked out only on the falling edge of clk. status register the spi interface can access the 1-bit status register required to support tag memory flash programming. the programming complete status register: this is the sing le bit status register for pooling. if the programming or erase operation is complete, then the status bit is set to 1, otherwise it is set to 0 for more programming or erase time. commands table 10-21. commands read_id (98h) the read_id command captures the ieee 1149.1 jtag idcode out of the device on the so pin. this command is commonly used to verify whether communication is es tablished with the spi bus. after the 8-bit read_id com- mand is received, the device ignores the data presented at the serial data input (si) pin. the serial output (so) pin is enabled on the falling edge of clock 31 to drive out the first bit of the idcode. after 32 bits of the idcode are shifted out, additional clocking will ca use dummy data to be shifted out on so. command name byte 1 (opcode) byte 2 byte 3 byte 4 byte 5 byte 6 n-byte read_id 0x98 0x00 0x00 0x00 (d0-d7) (d8-d15) (d24-d31) write_en 0xac 0x00 0x00 0x00 write_dis 0x78 0x00 0x00 0x00 erase_tag 0x0e 0x00 0x00 0x00 program_tag 0x8e 0x00 0x00 0x00 d7-d0 next byte last byte read_tag 0x4e 0x00 0x00 0x00 (d7-d0) (next byte) (continue) status 0x4a 0x00 0x00 0x00 (b1xxxxxxx or b0xxxxxxx) notes: 1. data bytes are shifted with most signi ficant bit first. byte field with data in parenthesis ( ) indicate data being read from the so pin. 2. byte 2-4 are dummy clocks to provide extr a timing for the device to execute the command. the data presented at the si pin dur ing these dummy clocks can be any value and do not have to be 0x00 as shown. 3. the read_id command reads out the 32 bits jtag idcode of the de vice. the first bit shifted out on so pin is thus bit 0 of the jtag idcode and the last bit is bit 31 of the idcode. 4. the program_tag command supports page programming only. the progra mming data shift into the tag memory must be exactly the same size as the one page of the tag memory. under shifting or over shifting will cause erroneous data programmed into the tag mem- ory. the last byte shown on the n-byte column indicates the last byte of the data must be shifted into the device before drivin g the chip select to high to start the programming action. 5. the status command read from the single bi t status register. when read from the regi ster, only the first bit is valid, the ot her bits are dum- mies and should be ignored.
10-45 lattice semiconductor lattice xp2 memory usage guide figure 10-50. read_id waveform write_en (ach) the write_en command enables the tag memory for programming. if the write_en command has not been shifted into the device first, the program_tag, erase _tag and status commands do not take effect. this is to prevent the tag memory from erroneous erase or program. the command is executed when the chip select pin is driven from low to high after the 24th dummy clock. any extra dummy clocks, if presented before driving the chip select pin to high, are ignored. after the chip select pin is driven from low to high, a minimum of three clocks are required to complete the execution of the command. the effect of this command is terminated by the write_dis command. figure 10-51. write_en waveform write_dis (78h) the write_dis command disa bles the tag memory for programming. it does not nullify the read_tag and read_id commands. the command is executed when the chip select pin is driven from low to high after the 24th dummy clock. any extra dummy clocks, if presented before driving the chip select pin to high, are ignored. after the chip select pin is driven from low to high, a minimum of three clocks are required to complete the execution of the command. cs clk si so hi-z 32 bits jtag idcode 8 bits read_id command 0 1 2 31 hi-z 24 bits dummy cs clk si so high impedance 3 clocks to initiate and complete opti onal extra clocks 8 command shifting clocks
10-46 lattice semiconductor lattice xp2 memory usage guide figure 10-52. write_dis waveform erase_tag (0eh) the erase_tag command is enabled afte r the command write_en has been shifted into the device and exe- cuted. the erase_tag command erases all the tag memory flash cells. the command is executed when the chip select pin is driven from low to high after the 24th dummy clock. any extra dummy clocks, if presented before driving the chip select pin to high, are ignored. after the chip select pin is driven from low to high, a minimum of three clocks is required to initiate the erase action. after the three clocks, extra clocks are optional. once the erase action is initiate d, it will be carried out until it is done. there is no mecha- nism to terminate the erase action. this command sets the status bit to 0 when the erase action begins. the programming engine sets the status bit to 1 when the erase is done successfully. figure 10-53. erase_tag waveform program_tag (8eh) the program_tag is enabled after the command write_en has been shifted into the device and executed. the program_tag command programs the entire tag memory page at once. after the command is shifted into the device on the si pin, and followed by 24 dummy clocks, the tag memory col- umn decoder serves as the data buffer for the programming data to be shifted into serially. the shifting direction is from left to right, as shown. the first bit to be shifted out closest to the so pin appears on the right-most side of the shift register. the data buffer functions like a fifo (first in first out) serial data shift register. in order to make sure that bit 0 will be read out first, data bit 0 must be shifted in to the right-most location of the data shift register. to achieve this, the data buffer must be filled up complete ly. consequently, over-filling the data buffer will cause over- flow of the data buffer, resulting in loss of data. cs clk si so high impedance three clocks to initiate and complete optional extra clocks 8 command shifting clocks cs clk si so high impedance three clocks to initiate the erase action optional extra clocks 8 command shifting clocks
10-47 lattice semiconductor lattice xp2 memory usage guide the so pin stays in the highz state throughout this command. figure 10-54. bit shifting order when the data buffer has filled up to on e page of data, driving the chip select pin to high terminates the data shift- ing. after the chip select pin is driven from low to high, a minimum of three clocks are required to initiate the pro- gramming action. in the programming action, the data buffer content is copied in parallel from the data buffer into the tag memory flash cells. the status bit is set to 0 when the programming actions begin. the status bit is set to 1 when the programming action is done successfully. figure 10-55. data buffer to flash cell mapping when the programming action complete, the status bit is set to 1. the exact same image is written into the flash cells of the tag memory block when the programming action complete. figure 10-56. program_tag waveform read_tag (4eh) the read_tag command enables the flash programming engi ne to transfer data programmed in the flash cells to the data buffer. the transfer action starts on the third dummy clock after the 8-bit opcode. the delay time derived from the 21 dummy clocks is the time required to transfer the flash cells data into the data buffer. the transfer action, once initiated, does not need the clock to continue to run. the clock count is only required to enable the so pin. if the flash circuitry is not yet enabled, the device w ill need extra delay time to enable the flash circuitry before transfer can take place. this extra delay must be provided after the third dummy clock and before the 24th dummy clock. if the read_tag command is preceded by the write _en command, then it is fast read. the device does not require extra delay to enable the flash circuitry. the 20 dummy clocks after the transfer is initiated to before enabling the so pin are considered delay clocks. si so bit 0 bit n-1 flash memory cells bit n-1 bit 0 flash cell 0 flash cell n-1 cs clk si so high impedance three clocks to initiate the program action optional extra clocks 8 command shifting clocks
10-48 lattice semiconductor lattice xp2 memory usage guide delay time = 20 x 1/frequency. the transfer delay time, including the extra delay time to enable the flash circuitry, is 5us minimum. the clock fre- quency can then be set to 2.5 mhz if continuous clocking is desired. when all the data captured into the da ta buffer are shif ted out, additional clocks will shift out dummy data. the si pin is not connected to the input of the data buffer when the read_tag command is shifted into the device. while the data in the data buffer is shifted out to the direction of so, dummy data is shifted into the data buffer. conse- quently, when over-shifting occurs, dummy data of unknown value is shifted out. figure 10-57. readout order figure 10-58. read_tag waveform status (4ah) the status command allows the single-bit status register to be read. this command can be loaded at any time after the write_en command has already been shifted into the device first. this command does not terminate the programming or erase action. it is used to report the progress of the programming or erase action. the status register actual size is only 1 bit. dummy data is shifted out on the so pin if extra data shifting clocks are applied. the command can be shifted into the device again to capture the status bit and then read out. during the interval of shifting the command, the addition al programming or erase time is provided by driving the chip select pin to high and holding the clk pin low. clocking while holding the chip select pin high is optional. if the maximum programming time or eras ure has expired and the status bit still is not set to 1, then erase or pro- gramming has failed. flash memory cells bit 0 bit n-1 flash cell 0 flash cell n-1 so bit 0 bit n-1 cs clk si so hi-z 8 bits read_tag command 0 1 2 n-1 hi-z 24 bits dummy enable so on 24th dummy clock. bit 0 is valid. time elapsed must be 5s data capture starts at 21st clock if the clock is too fast add delay before 21st clock tag memory data
10-49 lattice semiconductor lattice xp2 memory usage guide figure 10-59. status waveform specifications and timing diagrams powering up tag memory is available when the boot-up either from the internal embedded flash or from the external spi flash boot prom is complete. if th e embedded flash is blank , the boot up will not work. it is recommended to wait for the same amount of delay as if the embedded configuration has been programmed before accessing the tag memory. if the boot-up is from external spi flash, longer delay time should be given or check the done pin for a high first before accessing the tag memory. the spi interface needs the low-to-high transition on the chip select pin to reset. during power-up, the low-to-high transition is assured by requiring the clk pin tracking the vcc. the other method is to drive the chip select pin to high then low then high to reset the spi interface before shifting the first command into the device. figure 10-60. device power-up waveform cs clk si so hi-z 8 bits read_tag command 0 1 2 dummy hi-z 24 bits dummy capture starts on third dummy clock enable so on 24th du mmy clock status bit 6 7 provide device additional erase or programming time power up timing and voltage level vccaux or vcc whichever is the last. vccmin boot up from the embedded flash. tag memory is fully accessible. chip select must track vcc.
10-50 lattice semiconductor lattice xp2 memory usage guide availability of tag memory tag memory is available most of time on the slave spi interface with the following exceptions: ? when the sram fuses are being accessed by the jtag port, slave spi interface or refreshing ? when the other flash cells are being accessed through the jtag port or slave spi interface ? while jtag bscan testing is taking place ? the slave spi interface is disabled with the persistent fuse programmed (set to off) ac timing ? 25 mhz maximum clk ? 5 us minimum read command delay ? 2 ms minimum delay from vccmin to shifting in the first command programming timing ? 1 sec. maximum erase time ? 5 ms maximum programming time programming via the jtag interface .vme files can be generated for the ispvm system software which only programs the tag memory. these .vme files are handled according to the standard ispvme flow. initializing memory in the ebr based rom or ram memory modes and the pfu based rom memory mode, it is possible to specify the power-on state of each bit in the memory array. each bit in the memory array can have one of two values: 0 or 1. initialization file format the initialization file is an ascii file, which users can cr eate or edit using any ascii editor. ipexpress supports three types of memory file formats: ? binary file ? hex file ? addressed hex the file name for the memory initialization file is *.me m (.mem). each row depicts the value to be stored in a particular memory location and the number of characters (or the number of columns) represents the number of bits for each address (or the width of the memory module). the initialization file is primarily used for configuring the roms. the ebr in ram mode can optionally use this ini- tialization file also to preload the memory contents. the tag memory uses hex or binary non-addressed files. since it is a spi, it cannot use the addressed hex file.
10-51 lattice semiconductor lattice xp2 memory usage guide binary file the file is essentially a text file of 0?s and 1?s. the ro ws indicate the number of words and columns indicate the width of the memory. memory size 20x32 00100000010000000010000001000000 00000001000000010000000100000001 00000010000000100000001000000010 00000011000000110000001100000011 00000100000001000000010000000100 00000101000001010000010100000101 00000110000001100000011000000110 00000111000001110000011100000111 00001000010010000000100001001000 00001001010010010000100101001001 00001010010010100000101001001010 00001011010010110000101101001011 00001100000011000000110000001100 00001101001011010000110100101101 00001110001111100000111000111110 00001111001111110000111100111111 00010000000100000001000000010000 00010001000100010001000100010001 00010010000100100001001000010010 00010011000100110001001100010011 hex file the hex file is essentially a text file of hex characters arranged in a similar row-column arrangement. the number of rows in the file is same as the number of address locations, with each row indicating the content of the memory location. memory size 8x16 a001 0b03 1004 ce06 0007 040a 0017 02a4 addressed hex addressed hex consists of lines of address and data. each line starts with an address, followed by a colon, and any number of data. the format of memfile is address: data data data data ... where address and data are hexa- decimal numbers. -a0 : 03 f3 3e 4f -b2 : 3b 9f the first line puts 03 at address a0, f3 at address a1, 3e at address a2,and 4f at address a3. the second line puts 3b at address b2 and 9f at address b3. there is no limitation on the values of address and data . the value range is automatically checked based on the values of addr_width and data_width. if there is an error in an address or data value, an error message is printed.
10-52 lattice semiconductor lattice xp2 memory usage guide users need not specify data at all address locations. if data is not specified at certain address, the data at that loca- tion is initialized to 0. ipexpress makes memory initialization possible both through the synthesis and simulation flows. flashbak? capability the latticexp2 fpga family offers flas hbak capability, which is a way to st ore the data in the ebrs to the flash memory upon user command. this protects the user?s data from being lost when the system is powered off. the flashbak module (stfa primitive) has a single-command -two-operation process (see figure 10-61). when the flashbak operation is initiated, an erase-ufm-flash signal is enabled to erase the flash, followed by the transfer- to-flash operation. once the transfer is done, the flash controller sends a transfer-done signal back to the user logic. during the flashbak operation, the ebrs are not ac cessible. there is no difference between the regular ebr ram configuration and the shadow fl ash (ufm) ebr ram configuration in the isplever gui. the presence of the stfa (flashbak) primitive in a design determines the ebr ram configuration. flashbak cannot be used if the soft-error detect (sed) is operating in an always mode. since there is no addressing but just a ?dump? of all ebr to flash, only one stfa module is necessary. multiple modules are not necessary or allowed. figure 10-61. flashbak primitive figure 10-62. flashbak waveform table 10-22. stfa port descriptions technical support assistance hotline: 1-800-lattice (north america) +1-503-268-8001 (outside north america) e-mail: techsupport@latticesemi.com internet: www.latticesemi.com port name corresponding hardware port name i/o description storen storecmdn i initiates to store the ebr content to flash ufmfail ufm_fail o store to flash operation failed ufmbusyn fl_busyn o tells the user whether the flash is in the busy state or not storen ufmfail ufmbusyn stfa storen ufm busyn 1.85s delay regardless of whether storen is released minimum pulse width = 780ns
10-53 lattice semiconductor lattice xp2 memory usage guide revision history date version change summary february 2007 01.0 initial release. july 2007 01.1 added flashbak capability section. november 2007 01.2 tag memory added. january 2008 01.3 updated read_tag commands waveform diagram. changed minimum delay between the 3rd and 24th dummy clock from 3s to 5s. february 2008 01.4 updated fifo_dc without output registers (non-pipelined) diagram. march 2008 01.5 ad ded flashbak waveform diagram. june 2008 01.6 removed read-before-write sysmem ebr mode. updated ?first in first out (fifo, fifo_dc) ? ebr based? section. june 2008 01.7 added tag memory timing waveforms and instructions. november 2008 01.8 updated the following waveform figures: generic timing diagram, read_id waveform, write_en wa veform, write_dis waveform, erase_tat waveform, program_taw waveform, read_tag waveform, status waveform. updated serial data input (si) text section. updated memory modules text section.
10-54 lattice semiconductor lattice xp2 memory usage guide appendix a. attribute definitions data_width data width is associated with the ra m and fifo elements. the data_width attribute will define the number of bits in each word. it takes the values as defined in the ram size tables in each memory module. regmode regmode or the register mode attribute is used to enable pipelining in the memory. this attribute is associated with the ram and fifo elements. the regmode attribute takes the noreg or outreg mode parameter that disables and enables the output pipeline registers. resetmode the resetmode attribute allows users to select the mode of re set in the memory. this attribute is associated with the block ram elements. resetmode takes two parameters: sync and async. sync means that the memory reset is synchronized with th e clock. async means that the memory reset is asynch ronous to clock. csdecode csdecode or the chip select decode attributes are asso ciated to block ram elements. cs, or chip select, is the port available in the ebr primitive that is useful when memory requires multiple ebr blocks cascaded. the cs signal forms the msb for the address when multiple ebr blocks are cascaded. cs is a 3-bit bus, so it can cascade eight memories easily. csdecode takes the following parameters: ?000?, ?001?, ?010?, ?011?, ?100?, ?101?, ?110?, and ?111?. csdecode values determine the decoding val ue of cs[2:0]. csdecode_w is chip select decode for write and csdecode_r is chip select decode for read for pseudo dual port ram. csdecode_a and csdecode_b are used for true dual port ram elements and refer to the a and b ports. writemode the writemode attribute is associated with the block ram elements. it takes the normal, writethrough, and readbeforewrite mode parameters. in normal mode, the output data does not change or get updated, during the write operation. this mode is sup- ported for all data widths. in writethrough mode, the output data is updated with the input data during the write cycle. this mode is sup- ported for all data widths. in readbeforewrite mode, the output data port is updated with the existing data stored in the write address, during a write cycle. this mode is supported for x9, x18 and x36 data widths. writemode_a and writemode_b are used for dual port ram elements and refer to the a and b ports in case of a true dual port ram. for all modes (of the true dual port module), simultaneous read access from one port and write access from the other port to the same memory address is not recommended. the read data may be unknown in this situation. also, simultaneous write access to the same address fr om both ports is not recommended. (when this occurs, the data stored in the address becomes undetermined when one port tries to write a ?h? and the other tries to write a ?l?). it is recommended that the designer implements control logi c to identify this situatio n if it occurs and either: 1. implement status signals to flag the read data as possibly invalid, or 2. implement control logic to prevent the simultaneous access from both ports. gsr gsr or the global set/ reset attribute is used to enable or disable the global set/reset for ram element.
www.latticesemi.com 11-1 tn1138_01.3 june 2009 technical note tn1138 ? 2009 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. introduction latticexp2? devices support double data rate (ddr) and si ngle data rate (sdr) interf aces using the logic built into the programmable i/o (pio). sdr applications capture data on one edge of a clock while the ddr interfaces capture data on both the rising and falling edges of the clock, thus doubling performance. the latticexp2 i/os also have dedicated circuitry to support ddr and ddr2 sdram memory interfaces. this technical note details the use of latticexp2 devices to implement both a high-speed generic ddr interface and ddr and ddr2 memory inter- faces. ddr and ddr2 sdram interfaces overview a ddr sdram interface will transfer data at both the rising and falling edges of the clock. the ddr2 is the second generation of the ddr srdram memory. the ddr and ddr2 sdram interfaces rely on the use of a data strobe signal, called dqs, for high-speed opera- tion. the ddr sdram interface uses a single-ended dqs strobe signal, whereas the ddr2 interface uses a dif- ferential dqs strobe. figures 11-1 and 11-2 show typical ddr and ddr2 sdram interface signals. sdram interfaces are typically impl emented with eight dq data bits per dqs. an x16 inte rface will use two dqs signals and each dqs is associated with eight dq bits. both the dq and dqs are bi-directional ports used to both read and write to the memory. when reading data from the external memory device, data coming into the device is edge-aligned with respect to the dqs signal. this dqs strobe signal needs to be phase-shifted 90 degrees before fpga logic can sample the read data. when writing to a ddr/ ddr2 sdram, the memory controller (fpga) must shift the dqs by 90 degrees to center-align with the data signals (dq). a clock si gnal is also provided to the memory. this clock is pro- vided as a differential clock (clkp and clkn) to minimize duty cycle variations. the memory also uses these clock signals to generate the dqs signal during a read via a dll inside the memory. figures 11-3 and 11-4 show dq and dqs timing relationships for read and write cycles. for other detailed timing requirements, please refer to the ddr sdram jedec specification (jesd79c). during read, the dqs signal is low for some duration after it comes out of tristate. th is state is called preamble. the state when the dqs is low before it goes into tristate is the postamble state. this is the state after the last valid data transition. ddr sdram also requires a data mask (dm) signal to mask data bits during write cycles. note that the ratio of dqs to data bits is independen t of the overall width of the memory. an 8-bit interface will have one strobe signal. ddr sdram interfaces use the sstl25 class i/ii i/o standards whereas the ddr2 sdram interface uses the sstl18 class i/ii i/o standards. the ddr2 sdram interface also supports differential dqs (dqs and dqs#). latticexp2 high-speed i/o interface
11-2 lattice semiconductor latticexp2 high-speed i/o interface figure 11-1. typical ddr sdram interface figure 11-2. typical ddr2 sdram interface the following two figures show the dq and dqs relationship for memory read and write interfaces. figure 11-3. dq-dqs during read ddr memory fpga (ddr memory controller) 8 dq<7:0> dm dq<7:0> dqs address control command clk/clkn address control command clkp/clkn x address control command dq<7:0> dqs clk/clkn y z dqs dm dm fpga (ddr memory controller) ddr memory 8 dq<7:0> dm dq<7:0> dqs, dqs# address control command clk/clkn address control command clkp/clkn x address control command dq<7:0> dqs, dqs# clk/clkn y z dqs, dqs# dm dm dqs (at pin) preamble postamble dqs pin to reg and 90 degree phase shift dq (at pin) dqs (at reg) dq (at reg)
11-3 lattice semiconductor latticexp2 high-speed i/o interface figure 11-4. dq-dqs during write implementing ddr memory interf aces with latticexp2 devices as described in the ddrsdram overview section, the ddr sdram interfaces rely primarily on the use of a data strobe signal called dqs for high-speed operation. when reading data from the external memory device, data coming into the latticexp2 device is edge-aligned with re spect to the dqs signal. therefore, the latticexp2 device needs to shift the dqs (a 90-degree phase shift) before using it to sample the read data. when writing to a ddr sdram, the memory controller from the latticexp2 device must generate a dqs signal that is center-aligned with the dq, the data signals. this is accomplished by ensuring the dqs strobe is 90 degrees ahead relative to dq data. latticexp2 devices have dedicated dqs support circuitry for generating the appropriate phase shifting for dqs. the dqs phase shift circuit uses a freq uency reference dll to generate delay control signals associated with each of the dedicated dqs pins and is designed to compensate for process, voltage and temperature (pvt) variations. the frequency reference is provided through one of the global clock pins. the dedicated ddr support circuit is al so designed to provide comfortable and consistent marg ins for data sam- pling window. this section describes how to implement the read and write sectio ns of a ddr memory interface. it also provides details of the dq and dqs grouping rules associated with the latticexp2 devices. dqs grouping each dqs group generally consists of at least 10 i/os (one dqs, eight dq and one dm) to implement a complete 8-bit ddr memory interface. latticexp2 devices support dqs signals on all sides of the device. each dqs signal on the top and bottom halves of the device will span across 18 i/os and on the left and right sides of the device will span across 16 i/os. any 10 of these i/os spanned by the dqs can be used to implement an 8-bit ddr memory interface. in addition to the dqs grouping, the user must also assign one reference voltage vref1 for a given i/o bank. figure 11-5. dq-dqs grouping dqs (at pin) dq (at pin) dqs pad n* i/o pads (ninth i/o pad) dq or dm dq or dm *n=18 on bottom banks and n=16 on the left and right side banks.
11-4 lattice semiconductor latticexp2 high-speed i/o interface figure 11-5 shows a typical dq-dqs group for latticexp2 devices. the ninth i/o of this group of 16 or 18 i/os is the dedicated dqs pin. the 8 pads before of the dqs and 6/9 (6 for left and right side and 9 for top and bottom side) pads after the dqs are covered by the dqs bus span. users can assign any eight of these i/o pads to be dq data pins. hence, to implement a 32-bit wide memory interface you would need to use four such dq-dqs groups. when not interfacing with the memory, the dedicated dqs pin can be used as a general purpose i/o. each of the dedicated dqs pin is internally connected to the dqs phase shift circuitry. the pinout information contained in the latticexp2 family data sheet shows pin locations for the dqs pads. ddr software primitives this section describes the software primitives that ca n be used to implement ddr in terfaces. these primitives include: ? dqsdll ? the dqs delay calibration dll ? dqsbufc ? the dqs delay function and the clock polarity selection logic ? iddrmx1a ? the ddr input and dqs to system clock transfer registers with half clock cycle transfer ? iddrmfx1a ? the ddr input and dqs to system clock transfer registers with full clock cycle transfer ? oddrmxa ? the ddr output registers hdl usage examples for each of these primitives are listed in appendices a and b. dqsdll the dqsdll generates a 90-degree phase shift required for the dqs signal. this primitive implements the on- chip dqsdll. only one dqsdll should be instantiated for all the ddr implementations on one half of the device. the clock input to this dll should be at the same freq uency as the ddr interface. the dll generates the delay based on this clock frequency and the update control input to this block. the dll updates the dynamic delay con- trol to the dqs delay block when this update control ( uddcntl) input is asserted. fi gure 11-6 shows the primitive symbol. the active low signal on uddcntl updates the dqs phase alignment and should be initiated at the beginning of read cycles. figure 11-6. dqsdll symbol table 11-1 provides a description of the ports. table 11-1. dqsdll ports dqsdll update control: the dqs delay can be updated for pvt variation using the uddcntl input. the dqsdel is updated when the when the uddcntl is held low. the dqsdel can be updated when variations are expected. dqsdel can be updated anytime, except when the memory controller is receiving data from the memory. port name i/o description clk i system clk should be at the frequency of the ddr interface from the fpga core. rst i resets the dqsdll uddcntl i provides update signal to the d ll that will update the dynamic delay. lock o indicates when the dll is in phase. dqsdel o the digital delay generated by the dll, should be connected to the dqsbuf primitive. clk rst uddcntl lock dqsdel dqsdll
11-5 lattice semiconductor latticexp2 high-speed i/o interface dqsdll configuration: by default, this dll will generate a 90-degre e phase shift for the dqs strobe based on the frequency of the input reference clock to the dll. the user can control the sensitivity to jitter by using the lock_sensitivity attribute. this configuration bit can be programmed to be either ?high? or ?low?. the dll lock detect circuit has two modes of operation controlled by the lock_sensitivity bit, which selects more or less sensitivity to jitter. if this dll is operated at or above 150 mhz, it is recommended that the lock_sensitivity bit be programmed ?high? (more sensitive). when running at or below 100 mhz, it is recom- mended that the bit be programmed ?low? (more tolerant). for 133 mhz, the lock_sensitivity bit can go either way. dqsbufc this primitive implements the dqs dela y and the dqs transition detector logic. figure 11-7 shows the primitive symbol. figure 11-7. dqsbufc symbol the dqsbufc is composed of the dqs delay, the dqs transition detect and the dqsxfer block as shown in figure 11-8. this block inputs the dqs and delays it by 90 degrees. it also generates the ddr clock polarity and the dqsxfer signal. the preamble detect (prmbdet) signal is generated from the dqsi input using a voltage divider circuit. dqsi dqso dqsbufc clk read ddrclkpol dqsc prmbdet dqsdel xclk dqsxfer datavalid
11-6 lattice semiconductor latticexp2 high-speed i/o interface figure 11-8. dqsbufc function dqs delay block: the dqs delay block receives the digital control delay line (dqsdel) coming from one of the two dqsdll blocks. these control signals are used to delay the dqsi by 90 degrees. dqso is the delayed dqs and is connected to the clock input of the first set of ddr registers. dqs transition detect: the dqs transition detect block generates the ddr clock polarity signal based on the phase of the fpga clock at the first dqs transition. the ddr read control signal and fpga clk inputs to this coming and should be coming from the fpga core. dqsxfer: this block generates the 90-degree phase shifted clock to for the ddr wr ite interface. t he input to this block is the xclk. the user can choose to connect th is either to the edge clock or the fpga clocks. the dqsxfer is routed using the dqsxfer tree to all the i/os spanned by that dqs. data valid module: the data valid module generates a datavalid signal. this signal indicates to the fpga that valid data is transmitted out of the input ddr registers to the fpga core. table 11-2 provides a description of the i/o ports associated with the dqsbufc primitive. dqs delay dqs transition detect prmbdet dqsi dqso + - + - vref- dv* *dv ~ 170mv for ddr1 (sstl25 signaling) *dv ~ 120mv for ddr2 (sstl18 signaling) read fpga clk dqsdel vref ddrclkpol dqsc prmbdet dqsxfer xclk dqsxfer data valid module datavalid
11-7 lattice semiconductor latticexp2 high-speed i/o interface table 11-2. dqsbufc ports read pulse generation the read signal to the dqsbufc block is internally gene rated in the fpga core. the read signal goes high when the read command to control the ddr-sdram is in itially asserted. this precedes the dqs preamble by one cycle, yet may overlap the trailing bits of a prior read cycle. the dqs detect circuitr y of the latticexp2 device requires the falling edge of the read signal to be placed within the preamble stage. the preamble state of the dqs can be detected using the cas latency and the round trip delay for the signals between the fpga and the memory device. note that the internal fpga core generates the read pulse. the rise of the read pulse should coincide with the initial read command of the read burst and need to go low before the preamble goes high. figure 11-9 shows a read pulse timing example with respect to the prmbdet signal. figure 11-9. read pulse generation port name i/o description dqsi i dqs strobe signal from memory clk i system clk read i read generated from the fpga core dqsdel i dqs delay from the dqsdll primitive xclk i edge clock or system clk dqso o delayed dqs strobe signal, to the input capture register block dqsc o dqs strobe signal before delay, going to the fpga core logic ddrclkpol o ddr clock polarity signal prmbdet o preamble detect signal, going to the fpga core logic dqsxfer o 90 degree shifted clock going to the output ddr register block datavalid o signal indicating transmission of valid data to the fpga core read dqs prmbdet first dqs transition preamble prior read cycle postamble postamble ok read fail read fail vth read ok
11-8 lattice semiconductor latticexp2 high-speed i/o interface iddrmx1a this primitive will implement the input register block in memory mode. the ddr registers are designed to use edge clock routing on the i/o side and the primary clock on the fpga side. the eclk input is used to connect to the dqs strobe coming from the dqs delay block (dqsbufc primitive). the sclk input is connected to the system (fpga) clock. ddrclkpol is an input fr om the dqs clock polarity tree. this signal is generated by the dqs transition detect circuit in the hardwa re. the ddrclkpol signal is used to choose the polarity of the sclk to the synchronization registers. figure 11-10. iddrmx1a symbol table 11-3 provides a description of all i/o ports associated with the iddrmx1a primitive. table 11-3. iddrmx1a ports figure 11-11 shows the input register block configured in the iddrmx1a mode. port name i/o definition d i ddr data eclk i the phase shifted dqs should be connected to this input rst i reset sclk i system clk ce i clock enable ddrclkpol i ddr clock polarity signal qa o data at positive edge of the clk qb o data at the negative edge of the clk note: the ddrclkpol input to iddrmx1a should be connected to the ddrclkpol output of dqsbufc. iddrmx1a eclk rst qa qb d sclk ce ddrclkpol
11-9 lattice semiconductor latticexp2 high-speed i/o interface figure 11-11. input register block in iddrmx1a mode figure 11-12 shows the iddrmx1a timing waveform. data iddrmx1a qb qa ddr registers synchronization registers b c e d a eclk sclk ddrclkpol
11-10 lattice semiconductor latticexp2 high-speed i/o interface figure 11-12. iddrmx1a waveform iddrmfx1a with the iddrmx1a, the data can enter the fpga at either the positive or negative edge of the sclk depending on the state of the ddrclkpol signal. the iddrmfx1a modul e includes an additional clock transfer stage that ensures that the data is transferred at a known edge of the system clock. figure 11-13. iddrmfx1a symbol table 11-4 provides a description of all i/o ports associated with the iddrmfx1a primitive. dqs at i/o ddr data at i/o eclk( dqs shifted 90 deg) p0 n0 p1 n1 n2 p2 p3 n3 p4 p0 n0 p1 n1 p2 n2 p3 n3 p4 n0 n1 n2 n3 p0 p1 p2 p3 xx xx ddr data at iddrmx1a a b qa p0 p1 p2 p3 p4 p0 p1 p2 p3 p4 xx n4 n4 c p0 p1 p2 p3 xx qa sclk sclk case 1: ddrclkpol = 0 case 2: ddrclkpol = 1 qb n0 n1 n2 n3 xx n0 n1 n2 n3 xx qb iddrmfx1a eclk rst qa qb d clk1 ce ddrclkpol clk2
11-11 lattice semiconductor latticexp2 high-speed i/o interface table 11-4. iddrmfx1a ports figure 11-14 shows the latticexp2 input register block configured to function in the iddrxmfx1a mode. the ddr registers are designed to use edge clock routing on the i/o side and the primary clock on the fpga side. the eclk input is used to connect to the dqs strobe coming from the dqs delay block (dqsbufc primitive). the clk1 and clk2 inputs should be connected to the slow system (fpga) clock. ddrclkpol is an input from the dqs clock polarity tree. this signal is generated by the dqs transition detect circuit in the hardware. the addi- tional clock transfer registers are shared with the output register block. figure 11-14. input register block in iddrmfx1a mode figure 11-15 shows the iddrmfx1a timing waveform. port name i/o description d i ddr data eclk i the phase shifted dqs should be connected to this input rst i reset clk1 i slow fpga clk clk2 i slow fpga clk ce i clock enable ddrclkpol i ddr clock polarity signal qa o data at the positive edge of the clk qb o data at the negative edge of the clk note: the ddrclkpol input to iddrmfx1a should be connected to the ddrclkpol output of dqsbufc. data iddrmfx1a qb qa ddr registers synchronization registers clock transfer registers b c e d h i a eclk clk2 clk1 ddrclkpol
11-12 lattice semiconductor latticexp2 high-speed i/o interface figure 11-15. iddrmfx1a waveform oddrmxa the oddrmxa primitive implements the out put register for both th e write and the tristate functions. this primitive is used to output ddr data and the dqs strobe to the memory. all the ddr output tristate functions are also imple- mented using this primitive. figure 11-16 shows the oddrmxa primitive symbol and its i/o ports. figure 11-16. oddrmxa symbol table 11-5 provides a description of all i/o ports associated with the oddrmxa primitive. dqs at i/o ddr data at i/o eclk( dqs shifted 90 deg) p0 n0 p1 n1 n2 p2 p3 n3 p4 p0 n0 p1 n1 p2 n2 p3 n3 p4 n0 n1 n2 n3 p0/n0 p1/n1 p2/n2 p3/n3 xx xx ddr data at iddrmfx1a a b d/e p0 p1 p2 p3 p4 p0 p1 p2 p3 p4 xx n4 n4 c clk2 p0 p1 p2 p3 xx n0 n1 n2 n3 xx qa qb p0/n0 p1/n1 p2/n2 p3/n3 xx d/e clk1 clk1 case 1: ddrclkpol = 0 case 2: ddrclkpol = 1 oddrmxa clk da db q rst dqsxfer
11-13 lattice semiconductor latticexp2 high-speed i/o interface table 11-5. oddrmxa ports figure 11-17 shows the latticexp2 output register block configured in the oddrxma mode. figure 11-17. output register block in oddrxma mode figure 11-18 shows the oddrmxa timing waveform. port name i/o description clk i system clk or eclk da i data at the negative edge of the clock db i data at the positive edge of the clock rst i reset dqsxfer i 90-degree phase shifted cloc k coming from the dqsbufc block q i ddr data to the memory notes: 1. rst should be held low during ddr write operation. 2. ddr output and tristate registers do not have ce suppor t. rst is available for the tristate ddrx mode (while read- ing). the lsr will default to set when used in the tristate mode. 3. when asserting reset during ddr writes, it is important to keep in mind that this only resets the flip-flops and not the latches. q da db oddrxma eclk a0 b0 c0 dqsxfer
11-14 lattice semiconductor latticexp2 high-speed i/o interface figure 11-18. oddrmxa waveform note that the dqsxfer is inverted inside the oddrxma. this will ca use the data coming out of the oddrxma to be -90 in phase with the output of the oddrxc module. memory read implementation latticexp2 devices contain a variety of features to simplify implementation of the read portion of a ddr interface: ? dll compensated dqs delay elements ? ddr input registers ? automatic dqs to system clock domain transfer circuitry ? data valid module dll compensated dqs delay elements the dqs from the memory is connected to the dqs delay element. the dqs delay block receives a 6-bit delay control from the on-chip dqsdll. the latticexp2 devices support two dqsdll, one on the left and one on the right side of the device. the dqsdel generated by the dqsdll on the left side is routed to all the dqs blocks on the left and bottom/top half of the device. the delay generated by the dqsdll on the right side is distributed to all the dqs delay blocks on the right side and the other bottom/top half of the device. these digital delay control sig- nals are used to delay the dqs from the memory by 90 degrees. the dqs received from the memory is delayed in each of the dqs delay blocks and this delay dqs is used to clock the first set stage ddr input registers. dqs transition detect or automatic clock polarity select in a typical ddr memory interface design, the phase relation between the incoming delayed dqs strobe and the internal system clock (during the read cycle) is unknown. prior to the read operation in ddr memories, dqs is in tristate (pulled by termination). co ming out of tristate, the ddr memory de vice drives dqs low in the preamble state. the dqs transition detect block detects the first dqs rising edge after the preamble transition and gener- ates a signal indicating the required polarity for the fp ga system clock (ddrclkpol). this signal is used to con- trol the polarity of the clock to the synchronizing registers. eclk reg a0 reg b0 p0 p1 p2 p3 p4 latch c0 p0 p1 p2 p3 p4 n0 n1 n2 n3 xx n4 n0 n1 n2 n3 xx n4 .. .. n0 n1 n2 q n3 xx xx xx da db p0 n0 p1 n1 p2 n2 p3 xx n3 p4 dqsxfer
11-15 lattice semiconductor latticexp2 high-speed i/o interface data valid module the data valid module generates a datavalid signal. this signal indicates to the fpga that valid data is transmit- ted out the input ddr registers to the fpga core. ddr i/o register implementation the first set of ddr registers is used to de-mux the ddr data at the positive and negative edge of the phase shifted dqs signal. the register that captures the positive-edge data is followed by a negative-edge triggered reg- ister. this register transfers the positive edge data from the first register to the negative edge of dqs so that both the positive and negative portions of the data are now aligned to the negative edge of dqs. the second stage of registers is clocked by the fpga clock, the polarity of this clock is selected by the ddr clock polarity signal generated by the dqs transition detect block. the i/o logic registers can be implemented in two modes: ? half clock transfer mode ? full clock transfer mode in half clock transfer mode the data is transferred to the fpga core after the second stage of the register. in full clock transfer mode, an additional stage of i/o registers clocked by the fpga clock is used to transfer the data to the fpga core. the latticexp2 family data sheet explains each of these circ uit elements in more detail. memory read implement ation in software three primitives in the isplever ? design tools represent the capability of these three elements. the dqsdll rep- resents the dll used for calibration. the iddrmx1a/iddrmfx1a primitive represents the ddr input registers and clock domain transfer registers with or without full clock transfer. finally, the dqsbufc represents the dqs delay block, the clock polarity control logic and the data valid module. figures 11-19 and 11-20 show the read interface block generated using the ipex press? tool in the isplever software. figure 11-19. software primitive implementation for memory read (half clock transfer) 6 ddrclkpol dqs lock dqsdll dqsi clk read dqsdel dq dqso sclk eclk ddrclkpol d rst ce qa qb rst uddcntl dqsdel datain_p datain_n dqsc prmbdet lock dqsbufc iddrmx1a dqsc prmbdet xclk dqsxfer datavalid dqsxfer datavalid reset clk uddcntl read ce xclk
11-16 lattice semiconductor latticexp2 high-speed i/o interface figure 11-20. software primitive implementation for memory read (full clock transfer) read timing waveforms figures 11-21 and 11-22 show read data transfer for half and full clock cycle data transfer based on the results of the dqs transition detector logic. this circuitry decides whether or not to invert the phase of fpga system clk to the synchronization registers based on the relative phases of prmbdet and clk. ? case 1: if the fpga clock is low on the first prmbdet tran sition, then ddrclkpol is low and no inversion is required. ? case 2: if the fpga clock is high on the first prmbdet, then ddrclkpol is high and the fpga clock (clk) needs to be inverted before it is used for synchronization. figure 11-21 illustrate s the ddr data timing using half clock transfer mode at different stages of the iddrmx1a registers. the first stage of the register captures data on the positive edge as shown by signal a and the negative edge as shown by signal b. data stream a goes through an additional half clock cycle transfer shown by signal c. phase-aligned data streams b and c are presented to the next stage registers clocked by the fpga clock. figure 11-22 illustrates the ddr data ti ming using full clock transfer mode at different stages of iddrmfx1a regis- ters. in addition to the first two register stages in the half clock mode, the full clock transfer mode has an additional stage register clocked by the fpga clock. in this case, d and e are the data streams after the second register stage presented to the final stage of registers clocked by the fpga clock. 6 ddrclkpol dqs lock dqsdll dqsi clk read dqsdel dq dqso clk2 eclk ddrclkpol d rst ce qa qb rst uddcntl dqsdel datain_p datain_n dqsc prmbdet lock dqsbufc iddrmfx1a dqsc prmbdet xclk dqsxfer datavalid dqsxfer datavalid clk1 reset clk uddcntl read ce xclk
11-17 lattice semiconductor latticexp2 high-speed i/o interface figure 11-21. read data transfer when using iddrmx1a notes: 1. ddr memory sends dq aligned to dqs strobe. 2. the dqs strobe is delayed by 90 deg rees using the dedicated dqs logic. 3. dq is now center al igned to dqs strobe. 4. prmbdet is the preamble detect signal generated using the dqsb ufb primitive. this is used to generate the ddrclkpol signal. 5. the first set of i/o registers, a and b, c apture data on the positive and negative edges of dqs. 6. i/o register c transfers data so that both data are now aligned to negative edge of dqs. 7. ddclkpol signal generated will determine if the fpga clk going into the synchronization registers need to be inverted. the dd rclk- pol=0 when the fpga clk is low at the first rising edge of prmbde t. the clock to the synchronization registers is not inverted. the ddrclkpol=1 when the fpga clk is high at the first rising edge of prmbdet. in this case the clock to the synchronization regist er is inverted. 8. the i/o synchronization registers capture data on either the rising or falling edge of the fpga clock. 9. the datavalid signal goes high when valid data enters the fpga core. once data valid is asserted, it stays high until the nex t read pulse. ddrclkpol= 0 dqs at pin dq at pin dqs at iol fpga clk prmbdet clk to sync io registers a b c p0 n0 n1 p1 p0 n0 p1 n1 p0 p1 n0 n1 p0 p1 p0 n0 qa qb dq at iol fpga clk ddrclkpol=1 p0 n0 clk to sync io registers qa qb datavalid
11-18 lattice semiconductor latticexp2 high-speed i/o interface figure 11-22. read data tr ansfer when using iddrmfx1a notes: 1. ddr memory sends dq aligned to dqs strobe. 2. the dqs strobe is delayed by 90 deg rees using the dedicated dqs logic. 3. dq is now center-aligned to dqs strobe. 4. prmbdet is the preamble detect signal generated using the dqsb ufb primitive. this is used to generate the ddrclkpol signal. 5. the first set of i/o registers, a and b, c apture data on the positive and negative edges of dqs. 6. i/o register c transfers data so that both data are now aligned to the negative edge of dqs. 7. ddclkpol signal generated will determine if the fpga clock goi ng into the synchronization registers need to be inverted. the ddrclk- pol=0 when the fpga clk is low at the first rising edge of prmbdet. so the clock to the synchronization registers is not invert ed. the ddrclkpol=1 when the fpga clk is high at the first rising edge of prmbdet. in this case the clock to the synchronization regist er is inverted. 8. registers d and e capture data at the fpga clock. 9. the data is then again registers at the fpga clock to ensure a full clock cycle transfer. 10.datavalid signal goes high when valid data enters the fpga core. once data valid is asserted, it stays high until the next r ead pulse. dqs at pin dq at pin dqs at iol fpga clk (case 1) ddrclkpol= 0 prmbdet clk to sync io registers a b c p0 n0 n1 p1 p0 n0 p1 n1 d e dq at iol fpga clk (case 2) ddrclkpol=1 clk to sync io registers d e qa qb p0 qa qb p0 n0 n1 p1 p0 p2 n0 n1 n2 p1 p0 n0 n1 p1 p0 p2 n0 n1 n2 n0 n1 n2 p1 p0 p2 p1 p0 p2 p2 n2 p2 n2 datavalid
11-19 lattice semiconductor latticexp2 high-speed i/o interface data read critical path data in the second stage ddr registers can be registered either on the positive edge or on the falling edge of fpga clock depending on the ddrclkpol signal. in order to ensure that the data transferred to the fpga core registers is aligned to the rising edge of the system clock, this path should be constrained with a half clock transfer. this half clock transfer can be forced in the software by assigning a multi-cycle constraint (multi-cycle of 0.5 x) on all the data paths to first pfu register. dqs postamble at the end of a read cycle, the ddr sdram device executes the read cycle postamble and then immediately tristates both the dq and dqs output drivers. since neither the memory controller (fpga) nor the ddr sdram device are driving dq or dqs at that time, these signals float to a level determined by the off-chip termination resistors. while these signals are floating, noise on the dqs strobe may be interpreted as a valid strobe signal by the fpga input buffer. this can cause the last read data captured in the iol input ddr registers to be overwrit- ten before the data has been transferred to the free running resynchronization registers inside the fpga. figure 11-23. postamble effect on read latticexp2 devices have extra dedicated logic in the in the dqs delay block that prevents this postamble problem. the dqs postamble logic is automatically implemented when the user instantiates the dqs delay logic (dqs- bufc software primitive) in the design. memory write implementation to implement the write portion of a d dr memory interface, two streams of si ngle data rate data must be multi- plexed together with data transitioning on both edges of the clock. in addition, during a write cycle, dqs must arrive at the memory pins center-aligned with the data, dq. along with the dqs strobe and data this portion of the inter- face must also provide the clkp, clkn address/command and data mask (dm) signals to the memory. it is the responsibility of the fpga ou tput control to edge-alig n the ddr output signals (addr,cmd, dqs, but not dq, dm) to the rising edge of the outgoing differential clock (clkp/clkn). challenges encountered by the during memory write: 1. dqs needs to be center-aligned with the outgoing ddr data, dq. 2. differential clk signals (clkp and clkn) need to be generated. p0 p1 n0 p0 dq at iol dqs at pin dq at pin dqs at iol p0 n0 n1 p1 n1 p0 n0 n1 p1 p1 clk at synce reg datain_p datain_n a b c p0 n0
11-20 lattice semiconductor latticexp2 high-speed i/o interface 3. the controller must meet the ddr interface specification for t dss and t dsh parameters, defined as dqs falling to clkp rising setup and hold times. 4. the ddr output data must be muxed from two sdr streams into a single outgoing ddr data stream. all ddr output signals (?addr, cmd?, dq s, dq, dm) are initially aligned to the rising edge of the fpga clock inside the fpga core. the relative phase of the signals may be adjusted in the iol logic before departing the fpga. these adjustments are shown in figure 11-24. latticexp2 devices contain ddr output and tri-state registers along with the dqsxfer signal generated by the dqsbufc that allows easy im plementation of the write portion of the ddr memory interfaces. the ddr output registers can be accessed in the design tools via the oddrmxa and the oddrxc primitives. the dqs signal and the ddr cl ock outputs are generated us ing the oddrxc primitive. as shown in the figure, the clkp and dqs signals are generated so that they are 180 degrees in phase with the clock. this is done by con- necting ?1? to the da input and ?0? to the db inputs of the oddrxc primitive. refe r to the ddr generic software primitive section of this document to see the oddrxc timing waveforms. the ddr clock output is then fed into a sstl differential output buffer to generate clkp and clkn differential clocks. generating the clkn in this manner prevents any skew between the two signals. when interfacing to ddr1, sdram memory clkp should be connected to the sstl25d i/o standard. when interfacing to ddr2 memory, it should be connected to the sstl18d i/o standard. the dqsxfer output from the dqsbufc block is the 90-degree phase shifted clock. this 90-degree phase shifted clock is used as an input to the oddrmxa block. the oddrmxa is used to generate the dq and dm data outputs going to the memory. in the oddrmxa module, the data is first registered using the eclk or fpga clock input and then shifted out using the dqsxfer signal. to ensure that the data going to the memory is center- aligned to the dqs, the dqsxfer is in verted inside the oddrxma primitive. this will generate data that is cen- ter-aligned to the dqs. refer to the software primitives section of this document for the oddrxma timing wave- forms. the ddr interface specification for t dss and t dsh parameters defined as dqs fa lling to clkp rising setup and hold times must be met. this is accomplished by ensuring that the clkp and dqs signals are identical in phase. the tristate control for the dqs and dq outputs can also be implemented using the oddrxc primitive. figure 11-24 shows the ddr write impl ementation using the ddr primitives.
11-21 lattice semiconductor latticexp2 high-speed i/o interface figure 11-24. software implementation for memory write clk q q q q q q ?1? ?0? ?1? ?0? dqstri_p clkp (clk+180) oddrxc oddrxc oddrxc oddrmxa oddrmxa oddrmxa dqsxfer (clk+90) eclk / fpga clock dqs (clk+180) dq (clk+270) dm (clk+270) clkn (clk) dqstri_n datatri_p datatri_n dataout_p dataout_n dmout_p dmout_n da db rst clk da db rst clk da db rst clk da db rst dqsxfer clk da db rst dqsxfer clk da db rst dqsxfer
11-22 lattice semiconductor latticexp2 high-speed i/o interface write timing waveforms figure 11-25 shows the ddr write side data transfer timing for the dq data pad and the dqs strobe pad. when writing to the ddr memory device, the dm (data mask) and the addr/ cmd (address and command) signals are also sent to the memory device along with the data and strobe signals. figure 11-25. ddr write da ta transfer for dq data design rules/guidelines listed below are some rules and guidelines to keep in mind when implementing ddr memory interfaces in the latticexp2 devices. ? the latticexp2 devices have dedicated dq-dqs banks. please refer to the logical signal connections of the groups in the latticexp2 family data sheet before locking these pins. ? there are two dqsdll on the device, one for the left half and one for the right half of the device. therefore, only one dqsdll primitive should be instantiated for each half of the device. since there is only one dqsdll on each half of the device, all the ddr memory interfaces on that half of the device should run at the same fre- quency. each of the dqsdll will generate 90-degree digital delay bits for all the dqs delay blocks on that half of the device based on the reference clock input to the dll. ? when implementing a ddr sdram interface, all interfac e signals should be connec ted to the sstl25 i/o stan- dard. in the case of the ddr2 sdram interface, the interface signal should be connected to sstl18 i/o stan- dard. ? for ddr2, the differential dqs signals need to be connected to sstl18 the dif ferential i/o standard. ? when implementing the ddr interface, the vref1 of the bank is used to provide the reference voltage for the interface pins. generic high speed ddr implementation in addition to the ddr memory interface, the i/o logic ddr registers can be used to implement high speed ddr interfaces. the input ddr registers can operate in full clock transfer and half clock transfer modes. the ddr input and output register also su pport x1 and x2 gearing rati os. a gearing capability is prov ided to mux/demux the i/o data rate (eclk) to the fpga clock rate (sclk). for ddr interfaces, this ratio is slightly different than the sdr ratio. a basic 2x ddr element provides four fpga side bits for two i/o side bits at half the clock rate on the fpga side. p0 n0 p1 n1 p2 n2 p3 xx n3 p4 eclk p0 p1 p2 p3 p4 n0 n1 n2 n3 n4 .. .. da db dqs clkp clkn dqsxfer dq ..
11-23 lattice semiconductor latticexp2 high-speed i/o interface the data going to the ddr registers can be optionally delayed before going to the ddr register block. generic ddr software primitives the ipexpress tool in the isplever so ftware can be used to generate the ddr modules. the various ddr modes described below can be configured in the ipexpress tool. the various modes are implemented using the following software primitives. ? iddrxc ? ddr generic input ? iddrfxa ? ddr generic input with full clock transfer (x1 gearbox) ? iddrx2b ? ddr generic input with 2x gearing ratio. ddrx2 inputs a double data rate signal as four data streams. two stages of ddr registers are used to conv ert serial ddr data at in put pad into four sdr data streams entering fpga core logic. ? oddrxc ? ddr generic output ? oddrx2b ? ddr generic output with 2x gearing ratio. the ddrx2 inputs four separate data streams and out- puts a single data stream to the i/o buffer. ? delayb ? the ddr input can be optionally delayed before it is input to the ddr registers. the user can choose to implement a fixed delay value or use a dynamic delay. iddrxc this primitive inputs ddr data at both edges of the clk and generates two streams of data. the clk to this mod- ule can be connected to either the edge clock or the primary fpga clock. figure 11-26 shows the primit ive symbol for iddrxc mode. figure 11-26. iddrxc symbol table 11-6 lists the port names and descriptions for the iddrxc primitive. table 11-6. iddrxc port names figure 11-27 shows the latticexp2 input register block configured in the iddrxfc mode. port name i/o definition d i ddr data clk i this clock can be connected to the eclk or the fpga clock ce i clock enable signal rst i reset to the ddr register qa o data at the positive edge of the clock qb o data at the negative edge of the clock d clk ce rst qb qa iddrxc
11-24 lattice semiconductor latticexp2 high-speed i/o interface figure 11-27. input register block configured as iddrxc figure 11-28 shows the timing waveform when using the iddrxc module. figure 11-28. iddrxc waveform iddrfxa this primitive inputs ddr data at both edges of clock clk1 and generates two streams of data aligned to clock clk2. clk1 can be connected either to the edge clock or the internal fpga clock. if the edge clock input is used for clk1 then clk2 should be generated from the same clock going to clk1. data iddrxc fpga clock edge clock qb qa ddr registers synchronization registers b c e d a clk clk at i/o ddr data at i/o clk at iddrxc p0 n0 p1 n1 n2 p2 p3 n3 p4 p0 n0 p1 n1 p2 n2 p3 n3 p4 n0 n1 n2 n3 p0 p1 p2 p3 xx xx ddr data at iddrxc a b qa p0 p1 p2 p3 p4 p0 p1 p2 p3 p4 xx n4 n4 c n0 n1 n2 n3 xx qb
11-25 lattice semiconductor latticexp2 high-speed i/o interface figure 11-29. iddrfxa symbol table 11-7 lists the port names and descriptions for the iddrfxa primitive. table 11-7. iddrfxa port names figure 11-31 shows the latticexp2 input register block configured in the iddrxfxa mode. clk1 used to register the ddr registers and the first set of synchronization registers. clk2 is used by the third stage of registers and should be clocked by the fpga clock. these clock transfer registers are shared with the output register block. figure 11-30. input register block configured as iddrfxa figure 11-31 shows the timing waveform when using the iddrfxa module. port name i/o description d i ddr data clk1 i this clock can be connected to the eclk or the fpga clock clk2 i this clock should be connected to the fpga clock ce i clock enable signal rst i reset to the ddr register qa o data at the positive edge of the clock qb o data at the negative edge of the clock d clk1 clk2 ce rst qb qa iddrfxa data iddrfxa fpga clock edge clock qb qa ddr registers synchronization registers clock transfer registers b c e d h i a clk1 clk2
11-26 lattice semiconductor latticexp2 high-speed i/o interface figure 11-31. iddrfxa waveform clk at i/o ddr data at i/o clk1 (shifted 90 deg) p0 n0 p1 n1 n2 p2 p3 n3 p4 p0 n0 p1 n1 p2 n2 p3 n3 p4 n0 n1 n2 n3 p0/n0 p1/n1 p2/n2 p3/n3 xx xx ddr data at iddrfxa a b d/e p0 p1 p2 p3 p4 p0 p1 p2 p3 p4 xx n4 n4 c clk2 p0 p1 p2 p3 xx n0 n1 n2 n3 xx qa qb
11-27 lattice semiconductor latticexp2 high-speed i/o interface iddrx2b this module is used when a gearing function is required. this primitive inputs the ddr data at both edges of the edge clock and generates four streams of data aligned to sclk. sclk is always half the frequency of eclk. it is recommended that the clkdiv module or pll be used to generate the sclk from the eclk. figure 11-32 shows the primitiv e symbol for the iddrx2b mode. figure 11-32. iddrx2b symbol table 11-8 lists the port names and descriptions for the iddrx2b primitive. table 11-8. iddrx2b port names figure 11-33 shows the latticexp2 in put register block configured in th e iddrx2b mode. th e ddr registers and the first set of synchronization registers are clocked by th e eclk input. the sclk is used to clock the third stage of register. this primitive will output fo ur streams of data. the 2x gearing func tion is implemented by using the syn- chronization registers of the complementary pio. the clock transfer registers are shared with the output register block. port name i/o description d i ddr data eclk i this clock can be connected to the fast edge clock sclk i this clock should be connected to the fpga clock ce i clock enable signal rst i reset to the ddr register qa0, qa1 o data at the positive edge of the clock qb0, qb1 o data at the neg ative edge of the clock d eclk sclk ce rst qa0 qa1 qb0 qb1 iddrx2b
11-28 lattice semiconductor latticexp2 high-speed i/o interface figure 11-33. input register block configured as iddrx2b figure 11-34 shows the timing waveform using the iddrx2b module. data iddrx2b sclk eclk true pio in lvds sysi/o pair comp pio in lvds sysi/o pair qb1 qa1 qb0 qa0 ddr registers synchronization registers clock transfer registers synchronization registers clock transfer registers b c e d g f h i a j k
11-29 lattice semiconductor latticexp2 high-speed i/o interface figure 11-34. iddrx2b waveform oddrxc this is the ddr output module. this primitive will input two data streams and mux them together to generate a sin- gle stream of data going to the sysio? buffer. the clk to this module can be connected to the edge clock or to the fpga clock. this primitive is also used for when ddr function is required for the tristate signal. figure 11-35 shows the primitive symbol for the oddrxc mode. figure 11-35. oddrxc symbol table 11-9 lists the port names and descriptions for the oddrxc primitive. clk at i/o ddr data at i/o eclk (shifted 90 deg) p0 n0 p1 n1 n2 p2 p3 n3 p4 p0 n0 p1 n1 p2 n2 p3 n3 p4 n0 n1 n2 n3 p0/n0 p1/n1 p2/n2 p3/n3 p0/n0 p1/n1 p2/n2 p0 p1 n0 n1 p2 p3 n2 n3 xx xx xx xx xx xx ddr data at iddrx2b a b d/e f/g xx p0 p1 p2 p3 p4 p0 p1 p2 p3 p4 xx n4 n4 c sclk qb1 qa1 qb0 qb1 clk da db rst q oddrxc
11-30 lattice semiconductor latticexp2 high-speed i/o interface table 11-9. oddrxc port names figure 11-36 shows the output register block of the latticexp2 device configured in oddrxc mode. figure 11-36. output re gister block in oddrc mode figure 11-37 shows the timing wave form when using the oddrxc module. figure 11-37. oddrxc waveform oddrx2b this ddr output module can be used when a gearbox function is required. this primitive inputs four data streams and muxes them together to generate a single stream of data going to the sysio buffer. port name i/o definition da i data at the negative edge of the clock db i data at the positive edge of the clock clk i this clock can be connected to the edge clock or to the fpga clock rst i reset signal q o ddr data output q da db oddrxc eclk a0 b0 c0 eclk reg a0 reg b0 p0 p1 p2 p3 p4 latch c0 p0 p1 p2 p3 p4 n0 n1 n2 n3 xx n4 n0 n1 n2 n3 xx n4 .. .. n0 n1 n2 q n3 xx xx xx da db p0 n0 p1 n1 p2 n2 p3 xx n3 p4
11-31 lattice semiconductor latticexp2 high-speed i/o interface ddr registers of the complementary pio are used in this mode. the complementary pio register can no longer be used to perform the ddr function. there are two clocks going to this primitive. the eclk is connected to the faster edge clock and the sclk is connected to the slower fpga clock. the ddr data output of this primitive is aligned to the faster edge clock. figure 11-38 shows the primitive symbol for the oddrx2b mode. figure 11-38. oddrx2b symbol table 11-10 lists the port names and descriptions for the oddrx2b primitive. table 11-10. oddrx2b port names figure 11-39 shows the latt icexp2 output register bl ock in the oddrx2b mode. port name i/o description da0, db0 i data at the negative edge of the clock da1, db1 i data at the positive edge of the clock eclk i this clock should be connected to the faster edge clock sclk i this clock should be connected to the slower fpga clock rst i reset signal q o ddr data output eclk sclk da0 da1 db0 db1 rst q oddrx2b
11-32 lattice semiconductor latticexp2 high-speed i/o interface figure 11-39. output register block configured in oddrx2b mode figure 11-40 shows the timing wave form when using the oddrxc module. q db0 db1 true pio in lvds sysi/o pair comp pio in lvds sysi/o pair da0 da1 oddrx2b sclk eclk a0 b0 c0 a1 b1 c1 d0 e0 f0
11-33 lattice semiconductor latticexp2 high-speed i/o interface figure 11-40. oddrx2b waveform delayb data going to the ddr registers can be optionally delayed using the delay block. the delay block receives 4-bit delay control. the 4-bit delay can be set using fixed multiplier values or it can be controlled by the user. the delayb block is available for us e with the input ddr registers. the delayb block can be configured when generating the ddr input modules in the ipexpress tool of the soft- ware. the delay can be adjusted in 35ps steps. users can choose from three types of delay values: 1. dynamic ? the delay value is controlled by the user logic using the del[3:0] input of the delayb block. sclk reg a0 reg b0 d1 d5 d9 d13 d17 latch c0 d1 d5 d9 d13 d17 d3 d7 d11 d15 xx d19 d3 d7 d11 d15 xx d19 .. .. d3 d7 d11 a ( mux0) d15 xx xx xx db0 db1 sclk reg a1 reg b1 d0 d4 d8 d12 d16 latch c1 d0 d4 d8 d12 d16 d2 d6 d10 d14 xx d18 d2 d6 d10 d14 xx d18 .. .. d2 d6 d10 b ( mux1) d14 d0 d2 d4 d6 d8 d10 d12 d14 xx xx xx xx da0 da1 d16 d1 d3 d5 d7 d9 d11 d13 xx d15 d17 d1 d3 d5 d7 d9 d11 d13 xx d15 d17 copy of a ( mux0) d0 d2 d4 d6 d8 d10 d12 d14 xx d1 d3 d5 d7 d9 d11 d13 xx d15 d1 d3 d5 d7 d9 d11 d13 d15 q d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 xx xx latch f0 reg e0 reg d0 eclk
11-34 lattice semiconductor latticexp2 high-speed i/o interface 2. fixed ? when choosing the fixed value, the user will also need to choose from one of the 16 multiplier val- ues. this will tie the inputs del[3:0] of the delayb bl ock to a fixed value dependi ng on the multiplier value chosen. 3. fixed_xgmii ? the del [3:0] will be configured with t he delay value required when implementing a xgmii interface. figure 11-41 shows the primitive symbol for the delayb mode. figure 11-41. delayb symbol table 11-11 lists the port names and descriptions for the delayb primitive. table 11-11. delayb port names design rules/guidelines listed below are some rules and guidelines for implementing generic ddr interfaces in latticexp2 devices. ? when implementing a 2x gearing mode, the complement pio registers are used. this complementary pio regis- ter can no longer be used and should not be connected. ddr usage in ipexpress ipexpress can be used to configure and generate the ddr memory interfac e and generic ddr module. the tool will generate an hdl module that will contain the ddr primitives . this module can be usin g in the top level design. figure 11-42 shows the main window of ipexpress. the ddr_generic and ddr_mem options under architech- ture->io are used to configure the ddr modules. port name i/o definition a i ddr input from the sysio buffer del (0:3) i delay inputs z o delay ddr data a del(0:3) z delayb
11-35 lattice semiconductor latticexp2 high-speed i/o interface figure 11-42. ipexpress main window ddr generic figure 11-43 shows the main window w hen ddr_generic is selected. the only entry required in th is window is the module name. other entries are set to the project settings. the user may change these entries if desired. after entering the module name, click on customize to open the configuration tab window as shown in figure 11-44. figure 11-43. ipexpress main window for ddr_generic
11-36 lattice semiconductor latticexp2 high-speed i/o interface configuration tab the configuration tab lists all user-accessible attribut es with default values set. upon completion, click generate to generate source and constraint files. the user may choose to use the .lpc file to load parameters. figure 11-44. configuration tab for ddr_generic the user can change the mode parameter to choose either input, output, bidirection or tristate ddr module. the other configuration parameters will change according to the mode selected. th e delay parameter is only available for input and bidirectional modes. sim ilarly the multiplier for fixed delay pa rameter is only available when the delay parameter is configured to fixed. table 11-12. user parameters in the ipexpress gui ddr_mem figure 11-45 shows the main window w hen ddr_mem is selected. similar to the ddr_generic, the only entry required here is the module name. other entries are set to the project settings. the user may change these entries user parameters description values/range default mode mode selection for the ddr block. input, output, bidirectional, tristate input data width width of the data bus. 1-64 8 gearing ratio gearing ratio selection. 1x, 2x 1 1x delay input delay configuration dynamic, fixed, fixed xgmii dynamic multiplier for fixed delay fixed delay setting. available only when delay is configured as fixed. 0-15 0 use single clk for 1x allows for the selection of a single clock for the gearing logic. on/off off 1. only 1x available when mode is bidirection or tristate.
11-37 lattice semiconductor latticexp2 high-speed i/o interface if desired. after entering the module name, click on customize to open the configuration tab window as shown in figure 11-46. figure 11-45. ipexpress main window for ddr_mem configuration tab the configuration tab lists all user-accessible attribut es with default values set. upon completion, click generate to generate source and constraint files. the user may choose to use the .lpc file to load parameters.
11-38 lattice semiconductor latticexp2 high-speed i/o interface figure 11-46. configuration tab for ddr_mem the user can change the mode parameter to choose either the ddr or ddr2 interface. the other configuration parameters will change according to the mode selected. the number of dqs pa rameter determines the number of ddr interfaces. the software will assume there are eight data bits for every dqs. the user can also choose the frequency of operation an d the ddr dll will be configured to this frequency. the user has an option to enable the clock enable and tristate enables for the ddr registers. it is recommend that the lock/jitter be enabled if the ddr interface is running at 150mhz or higher. the parameters available depend on the mode selected. tables 11-13 and 11-14 describe all user parameters in the ipexpress gui and their usage for modes ddr and ddr2. table 11-13. user parameters in the ipexpress gui when in ddr mode user parameters description values/range default i/o buffer configuration i/o standard used for the interface. this will also depend on the mode selected. sstl25_i, sstl25_ii sstl25_i data width width of the data bus 8-64 8 number of dqs number of dqs will determine the number of dqs groups 1, 2, 4, 8 1 frequency of dqs ddr interface frequency. this is also input to the ddr dll. the values will depend on the mode selected. 100mhz, 133mhz, 166mhz, 200mhz 200mhz lock/jitter sensitivity dll sensit ivity to jitter high, low high lsr for ddr input register lsr control reset, set reset create clock enable for ddr input register create clock enable inputs to the block on/off off tri-state enable for ddr output registers creates tri-state contro l for the ddr data output registers. on/off on ddr tristate enable for the dqs output creates tristate control for dqs output on/off on
11-39 lattice semiconductor latticexp2 high-speed i/o interface table 11-14. user parameters in the ipexpress gui when in ddr2 mode fcram (?fast cycle random access memory?) interface fcram is a ddr-type dram, which performs data output at both the rising and falling edges of the clock. fcram devices operate at a core voltage of 2.5v with sstl class ii i/o. it has enhanced both the core and peripheral logic of the sdram. in fcram the address and command signals are synchronized with the clock input, and the data pins are synchronized with the dqs signal. data output takes place at both the rising and falling edges of the dqs. dqs is in phase with the clock i nput of the device. the ddr sdram and ddr fcram controller will have differ- ent pinouts. latticexp2 devices can implement the fcram interface using dedicated dqs logic, input ddr registers and out- put ddr registers, as described in the implementing memory interfaces section of this document. generation of address and control signals for fcram are different than in ddr sdram devices. please refer to the fcram data sheets to see detailed specifications. toshiba, inc. and fujitsu, inc. offer fcram devices in 256mb densities. they are available in x8 or x16 configurations. board design guidelines the most common challenge associated with implementing ddr memory interfaces is the board design and lay- out. it is required that users strictly follow the guidelines recommended by memory device vendors. some of the common recommendations include matching trace lengths of interface signals to avoid skew, proper dq-dqs signal grouping, proper termination of the sstl2 or sstl18 i/o standard, proper vref and vtt gener- ation decoupling and proper pcb routing. the following documents include board layout guidelines: ? www.idt.com , idt, pcb design for double data rate memory ? www.motorola.com , an2582, hardware and layout design considerations for ddr interfaces references ? www.jedec.org , jedec standard 79, do uble data rate (ddr) sdram specification ? www.micron.com , ddr sdram data sheets user parameters description values/range default i/o buffer configuration i/o standard used for the interface. this will also depend on the mode selected. sstl18_i, sstl18_ii sstl18_i data width width of the data bus 8-64 8 number of dqs number of dqs will determine the number of dqs groups 1, 2, 4, 8 1 frequency of dqs ddr interface frequency. this is also input to the ddr dll. the values will depend on the mode selected. 166mhz, 200mhz, 266mhz 200mhz lock/jitter sensitivity dll sensit ivity to jitter high, low high lsr for ddr input register lsr control reset, set reset create clock enable for ddr input register create clock enable inputs to the block on/off off tri-state enable for ddr output registers creates tri-state contro l for the ddr data output registers. on/off on ddr tristate enable for the dqs output creates tristate control for dqs output on/off on dqs buffer configuration for ddr2 dqs buffer can be configured as differential on/off off
11-40 lattice semiconductor latticexp2 high-speed i/o interface ? www.infinion.com , ddr sdram data sheets ? www.samsung.com , ddr sdram data sheets ? www.toshiba.com , ddr fcram data sheet ? www.fujitsu.com , ddr fcram data sheet ? rd1019, qdr memory controller reference design ?ipug35, ddr1 & ddr2 sdram controller (pipelined versions) user?s guide technical support assistance hotline: 1-800-lattice (north america) +1-503-268-8001 (outside north america) e-mail: techsupport@latticesemi.com internet: www.latticesemi.com revision history date version change summary february 2007 01.0 initial release. may 2007 01.1 updated the port names on the input ddr block diagrams. updated text in dqs transition detect section under memory read implementation. february 2009 01.2 updated dll compensated dqs delay elements text section. june 2009 01.3 updated dqsdll update control text section.
www.latticesemi.com 12-1 tn1139_01.0 february 2007 technical note tn1139 ? 2007 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. introduction one requirement for design engineers us ing programmable devices is the abilit y to calculate the power dissipation for a particular device used on a board. lattice?s isplever ? design tools include the power calculator tool, which allows designers to calculate the power dissipation for a given device. this technical note describes how to use the power calculator tool to calculate the power consumption of the latticexp2? family of devices. general guidelines to reduce power consumption are also included. power supply sequencing and hot socketing latticexp2 devices have been designed to ensure predictable behavior during power-up and power-down. power supplies can be sequenced in any order. during power-up and power-down sequences, the i/os remain in tri-state until the power supply voltage is high enough to ensure relia ble operation. in addition, leakage into i/o pins is con- trolled to within the limits specified in the latticexp2 family data sheet , allowing for easy inte gration with the rest of the system. these capabilities make the latticexp2 ideal for many multiple power supply and hot-swap applica- tions. recommended power-up sequence as described above, the supplies can be sequenced in any order. however, once internal power good is achieved (determined by vcc, vccaux, vccio bank x) the device releases the i/os from tri-state and the management of the i/os becomes the designer's responsib ility. to simplify a system design, it is recommended that supplies be sequenced in the following order: vccio, vcc, vccaux. if vccio is tied to vcc or vccaux, then it is recom- mended that vccio and the associated power supply are powered up before the remaining supply. please refer to the hot socketing section of the latticexp2 family data sheet for more information. power calculator hardware assumptions power consumption for a device can be coarsely broken down into the dc portion and the ac portion. the power calculator reports the power dissipation in terms of: 1. dc portion of the power consumption. 2. ac portion of the power consumption. the dc power (or the static power consumption) is th e total power consumption of the used and the unused resources. these power components are fixed for each resource used and depends upon the number of resource units utilized. the dc component also in cludes the static power dissipation fo r the unused resources of the device. the ac portion of power consumption is associated with th e used resources. this is the dynamic part of the power consumption. its power dissipation is directly proportional to the frequency at which the resource is running and the number of resource units used. power calculation equations the following are the power equations used in the power calculator: power estimation and management for latticexp2 devices
12-2 power estimation and management lattice semiconductor fo r latticexp2 devices total dc power (resource) = total dc power of used portion + total dc power of unused portion = [dc leakage per resource when used * n resource ] + [dc leakage per resource when unused * (n total resource - n resource )] where: n total resource is the total number of resources in a device n resource is the number of resources used in the design the total dc power consumption for all the resources as per the design data is the quiescent power in the power calculator. the ac power is governed by the following equation: total ac power (resource) = k resource * f max * af resource * n resource where: n totalresource is the number of resources in a device n resource is the number of resources used in the design k resource is the power constant for the resource in mw/mhz f max is the max frequency at which the resource is running. frequency is measured in mhz. af resource is the activity factor for the resource group.the activity factor is a percentage of the switching frequency. for example, the power consumption of the slice portion is calculated in the following equation, total dc power (slice) = total dc power of used portion + total dc power of unused portion = [dc leakage per slice when used * n slice ] = +[dc leakage per slice when unused * (n totalslice - n slice )] total ac power (slice) = k slice * f max * af slice * n slice power calculations the power calculator allows users to estimate power consumption at three different levels: 1. estimate of the utilized resources before completing place and route 2. post place and route design 3. post place and route, post trace, and post simulation for the first level of estimation, the user provides estimate s of device usage in the power calculator wizard and the tool provides a rough estimate of the power consumption. the second level is a more accurate approach. the us er imports the actual device utilization by importing the post place and route netlist (ncd) file. the third level brings even more accuracy to the calculation by importing the trace (twr) file to populate the max- imum frequencies (f max ) into the tool. users also have the option of importing the information from the post simula- tion (vcd) file and calculating the activity factor and toggle rates of various components. these three stages of power calculation are discussed in detail in the following sections of this document.
12-3 power estimation and management lattice semiconductor fo r latticexp2 devices using the power calculator starting the power calculator the power calculator can be launched by one of two methods. the first method is to click the power calculator button in the toolbar as shown in figure 12-1. figure 12-1. starting power calculator from the toolbar the power calculator can also be launched by going to the tools menu and selecting the option power calcula- tor as shown in figure 12-2.
12-4 power estimation and management lattice semiconductor fo r latticexp2 devices figure 12-2. starting power calculator from tools menu note: the power calculator does not support some older lattice devices. the toolbar button and menu item are only present when supported devices are selected. creating a power calculator project after starting the power calculator, the power calculator window is displayed. click on the file menu and select new to get to the start project window as shown in figure 12-3. figure 12-3. power calculator start project window (create new project)
12-5 power estimation and management lattice semiconductor fo r latticexp2 devices the start project window is used to create a new power calc ulator project (*.pep project). three pieces of data are entered into the start project window. 1. the power calculator project name by default is same as the project navigator project name. it can be changed, if desired. 2. project directory is where the power calculator project (*.pep) file will be stored. by default it is stored in the main project folder. 3. the ncd file is automatically selected, if available, or users can browse to the ncd file in a different loca- tion. power calculator main window the power calculator main window is shown in figure 4. figure 12-4. power calculator main window (type view) the top pane of the window shows information about the device family, device and the part number as it appears in the project navigator. the vcc used for the power calculati on is also listed. users have the choice of selecting the core voltage vcc with +5% of the nominal value (or values). the option of selecting vccj is also available. users can provide the ambient temperature, and the junction temperature is calculated based on that. users can also enter values for airflow in linear feet per minute (lfm) along with heat sink to obtain the junction temperature. the table near the top of the power calculator main window summarizes the currents and power consumption associated with each type of power supply for the device. this also takes into consideration the i/o power supplies.
12-6 power estimation and management lattice semiconductor fo r latticexp2 devices in the middle pane of the window, there are three tabs: 1. power view the first tab is the power view. this tab provides an in teractive spreadsheet type in terface with all values in terms of power consumption mw. the first column breaks down the design in terms of clock domains. the second and third columns, which are shaded blue, provide the dc (static) and ac (dynamic) power consumption, respectively. next are four columns shaded blue. these provide information on the i/o dc and ac power, including core voltage, vcc and the i/o voltage supply, vccio. the first three rows show the quiescent power for vcc, vccaux and vccj. these are dc power num- bers for a blank device or devi ce with no resource utilization. some of the cells are shaded yellow. these cells are ed itable cells and users can type in values such as frequency, activity factors and resour ce utilization. the second tab (the report tab) is the summary of the power view. this report is in text format and provides details of the power consumption. 2. icc view the second tab is the icc view. this tab is exactly same as the power view tab, except that all values are expressed in terms of current or ma. 3. report view the third and final tab is the report view. this is an html type of power calculator report. it summarizes the contents of the power and icc views. the final pane, the lower pane of the window, is the log pane where users can see a log of the various operations in the power calculator. figure 12-5. power calculator main window (power report view)
12-7 power estimation and management lattice semiconductor fo r latticexp2 devices power calculator wizard the power calculator wizard allows users to estimate the power consumption of a design. this estimation is done before the design is created. it is important for the user to understand the logic requirements of the design. the wizard allows the user to provide the required parameters and then estimates the power consumption of the device. to start the power calculator in the wizard mode, go to the file menu and select wizard . alternatively, you can click on the wizard button to see the power calculator - wizard window as shown in figure 12-6. select the option create a new project and check the wizard check box in the power calculator start project window. provide the project name and the project folder and click continue . since this is power estimation before the actual design, no ncd file is required. figure 12-6. power calculator start project window (using the new project window wizard) in the next screen, the device family, device, and part number are chosen. after making the proper selections, click continue . this is shown in figure 7.
12-8 power estimation and management lattice semiconductor fo r latticexp2 devices figure 12-7. power calculator wizard mode window - device selection in the following screens (figures 8-12) users can select additional resources, such as i/o types, clock name, fre- quency at which the clock in running and other parameters by selecting the appropriate resource using the pull- down type menu. 1. routing resources 2. logic 3. ebr 4. i/o 5. pll 6. clock tree the number in these windows refers to the number of cl ocks and the index corresponds to each of the clocks. by default, the clock names are clk_1, clk_2, and so on. clock names can be changed by typing in the clock name text box. for each clock domain and resource, parameters such as frequency and activity factor can be specified. in the final window, click the create button for each clock driven resource to include the parameters specified for it.
12-9 power estimation and management lattice semiconductor fo r latticexp2 devices figure 12-8. power calculator wizard mode window - resource specification these parameters are then used in the power type view window, which can be seen upon clicking on finish (see figure 9). figure 12-9. power calculator wizard mode - main window
12-10 power estimation and management lattice semiconductor fo r latticexp2 devices creating a new project without the ncd file a new project can be started without the ncd file, either by using the wizard (as discussed above) or by selecting the create a new project option in the power calculator - start project. the project name and project directory must be provided. after clicking continue the power calculator main window will be displayed. however, in this case there are no resources added. the power estimation row for the routing resources is always available in the power calculator. additi onal information such as the slice, ebr, i/o, pll, and clock tree utilization must be provided to calculate the power consumption. for example, if the user wants to add the logic resources shown in figure 10, right-click on logic >> and then select add row in the menu that pops up. figure 12-10. power calculator main window - adding resources this adds a new row for the logic resource utilization with clock domain named clk_1. similarly, other resources like ebr, i/os, plls and routing can be added. each of these resources is used for ac power estimation and categorized by clock domains. creating a new projec t with the ncd file if the post place and routed ncd file is available, the power calculator can use it to import accurate information about the design data and resource ut ilization for power calculation. after st arting the power calculator, the ncd file is automatically placed in the ncd f ile option, if it is available in the project directory. otherwise, browse to the ncd file using the power calculator.
12-11 power estimation and management lattice semiconductor fo r latticexp2 devices figure 12-11. power calculator start project window with post par ncd file the information from the ncd file is automatically insert ed into the correct rows and power calculator uses the clock names from the design as shown in figure 12-12. figure 12-12. power calculator main window - resource utilizat ion picked up from the ncd file
12-12 power estimation and management lattice semiconductor fo r latticexp2 devices opening an existing project the power calculator - start project window also a llows users to open an existing project. select open existing project and browse to the *.pep project file and click continue . this opens the existing project in windows similar to those discussed above (see figure 12-13). figure 12-13. opening an existing project in power calculator importing a simulation file (vcd) a post simulation vcd file can be import ed into the power calculator project to estimate a design?s activity factors. under the file menu, select open simulation file and browse to the vcd f ile location and select open . all af and toggle rate fields are then populated with the information from this file, as shown in figure 12-14. figure 12-14. importing a simulation file in an existing power calculator project
12-13 power estimation and management lattice semiconductor fo r latticexp2 devices importing a trace report file (twr) post trace twr file can be imported into the power calculator project to estimate a design?s activity factors. under the file menu, select open trace report file , browse to the twr file location and select open . all freq. (mhz) fields are then populated with the information from this file, as shown in figure 12-15. figure 12-15. importing a trace report file to a power calculator project activity factor and toggle rate activity factor% (or af%) is defined as the percentage of frequency (or time) that a signal is active or toggling of the output. most of the resources associated with a clock domain are running or toggling at some percentage of the frequency at which the clock is running. users must prov ide this value as a percentage under the af% column in the power calculator tool. another term used is the i/o toggle rate or the i/o toggle frequency. the af% is applicable to the pfu, routing and memory read write ports, etc. the activity of the i/os is determined by the signals provided by the user (for inputs) or as an output of the design (for outputs). therefor e, the rates at which i/os toggle define their activity. the toggle rate (or tr) in mhz of the output is defined by the following equation: toggle rate (mhz) = 1/2 * f max * af% users must provide the tr (mhz) value for the i/o instead of providing the frequency and af% in case of other resources. the af can be calculated for each routing resource, output or pfu. however, it involves long calcula- tions. the general recommendation for a design occupying roughly 30% to 70% of the device is an af% of 15% to 25%. this is an average value that can be seen most of th e design. an accurate value for an activity factor depends upon clock frequency, stimulus to the design and the final output.
12-14 power estimation and management lattice semiconductor fo r latticexp2 devices ambient and junction temperatures and airflow a common method of characterizing a packaged device?s thermal performance is with thermal resistance, or ? . for a semiconductor device, thermal resistance indicates the steady state temperature rise of the die junction above a given reference for each watt of power (heat) dissipated at the die surface. its units are c/w. the most common examples are ? ja , thermal resistance junction-to-ambient (in c/w) and ? jc , thermal resis- tance junction-to-case (also in c/w). another factor is ? jb , thermal resistance junction-to-board (in c/w). knowing the reference (i.e. ambient, case, or board) temperature, the power, and the relevant ? value, the junction temp can be calculated by the following equations. t j = t a + ? ja * p (1) t j = t c + ? jc * p (2) t j = t b + ? jb * p (3) while t j , t a ,t c and t b are the junction, ambient, case (or package) and board temperatures (in c) respectively, p is the total power dissipation of the device. ? ja is commonly used with natural and forced convection air-cooled systems. ? jc is useful when the package has a high conductivity case mounted directly to a pcb or heatsink. and ? jb applies when the board temp adjacent to the package is known. the power calculator utilizes the ambient temperature (c) to calculate the junction temperat ure (c) based on the ? ja for the targeted device, per equation 1 above. users can also provide the airflow values (in lfm) to get a more accurate value of the junction temperature. managing power consumption one of the most critical design factors today is the reduc tion of system power consumption, especially for modern handheld devices and electronics . there are several design techniques that can significantly reduce overall system power consumption. some of these include: 1. reducing operating voltage. 2. operating within the specified package temperature limitations. 3. using the optimum clock frequency to reduce power co nsumption, since dynamic power is directly propor- tional to the frequency of operation. designers must determine if a portion of their design can be clocked at a lower rate that will reduce power. 4. reducing the span of the design across 5. reducing the voltage swing of the i/os where possible. 6. using optimum encoding where possible. for example, a 16-bit binary counter has, on average, only 12% activity factor and a 7-bit binary counter has an average of 28% activity factor. on the other hand, a 7-bit linear feedback shift register could toggle as much as 50% activity factor, which causes higher power consumption. a gray code counter, where only one bit changes at ea ch clock edge, will use the least amount of power, as the activity factor would be less than 10%. 7. minimize the operating temperature, by the following methods: a. use packages that can better dissipate heat. for example, packages with lower thermal impedance. b. place heat sinks and thermal pla nes around the device on the pcb. c. better airflow techniques using mechanical airflow guides and fans (both system fans and device mounted fans).
12-15 power estimation and management lattice semiconductor fo r latticexp2 devices power calculator assumptions the following are the assumptions made by the power calculator: 1. the power calculator tool is based on equations with constants based on a room temperature of 25c. 2. the user can define the ambient temperature (t a ) for device junction temperature (t j ) calculation based on the power estimation. t j is calculated from user-entered t a and power calculation of typical room tem- perature. 3. i/o power consumption is based on output loading of 5pf. users can change this capacitive loading. 4. the power calculator provides an estimate of the power dissipation and current for each of the following types of power supplies: vcc, vccio, vccj and vccaux. 5. the nominal vcc is used by default to calculate po wer consumption. a lower or higher vcc can be cho- sen from a list of available values. 6. airflow in linear feet per minute (lfm) can be entered by the user along with the heat sink option to cal- culate the junction temperature. 7. the default value of the i/o types is lvcmos12, 6ma. 8. the activity factor (af) is defined as the toggle rate of the registered output. for example, assuming that the input of a flip-flop is changing at every clock cycle, 100% af of a flip-flop running at 100mhz is 50mhz. technical support assistance hotline: 1-800-lattice (north america) +1-503-268-8001 (outside north america) e-mail: techsupport@latticesemi.com internet: www.latticesemi.com revision history date version change summary february 2007 01.0 initial release.
www.latticesemi.com 13-1 tn1140_01.0 february 2007 technical note tn1140 ? 2007 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. introduction this technical note discusses how to access the features of the latticexp2? sysdsp? (digital signal process- ing) block described in the latticexp2 family data sheet . designs targeting the sysdsp block can offer significant improvement over traditional lut-based implementations. table 13-1 provides an example of the performance and area benefits of this approach: table 13-1. sysdsp block vs. lut-based multipliers sysdsp block hardware the latticexp2 sysdsp blocks are located in rows throughout device. below is a block diagram of one of the sys- dsp blocks: figure 13-1. latticexp2 sysdsp block multiplier width register pipelining xp2-17-7 uses one sysdsp block xp2-17-7 uses luts f max (mhz) 1 luts f max (mhz) 1 luts 9x9 input, multiplier, output 365 0 103 192 18x18 input, multiplier, output 365 0 76 698 36x36 input, multiplier, output 323 0 50 2732 1. these timing numbers were generated using the isplever ? design tool. exact performance ma y vary with design and tool version. outa0(18) outb0(18) outa1(18) outb1(18) outa2(18) outb2(18) outa3(18) outb3(18) summation (38) (two 20 bits in 9x9 mode) 36x36 (mult36) accumulator (52) 1 output registers intermediate pipeline registers adder, subtractor and accumulator functions one of these one of these 36x36, 18x18 and 9x9 multiplier functions output registers to sri of right-side sysdsp block (if it exists) and/or general logic* input registers from sro of left-side sysdsp block (or tied to zero if none) accumulator (52) 3 add/sub (36) (9x9 2x18) 1 pr0 (36) in reg a0 in reg a1 in reg b1 in reg a2 in reg a3 in reg b0 in reg b2 in reg b3 9x9 9x9 36 9x9 9x9 9x9 9x9 9x9 9x9 pr1 (36) pr2 (36) pr3 (36) mult18-0 mult18-1 mult18-2 mult18-3 add/sub (36) (9x9 2x18) 3 *can only be routed to general logic routing when configured with less than three mult18x18. 36 note: each sysdsp block spans nine columns of pfus. latticexp2 sysdsp usage guide
13-2 lattice semiconductor lattice xp2 sysdsp usage guide the sysdsp block can be configured as: ? one 36x36 multiplier ? basic multiplier, no add/sub/accum/sum blocks ? four 18x18 multipliers ? two add/sub/accum blocks ? one summation block for adding four multipliers ? eight 9x9 multipliers ? four add/sub blocks ? two summation blocks note that a sysdsp block can only be configured in one mode at a time. sysdsp block software overview the sysdsp block of the latticexp2 device can be targeted in a number of ways. ? the ipexpress? tool in the isplever software allows the rapid creation of modules implementing sysdsp ele- ments. these modules can then be used in hdl designs as appropriate. ? the coding of certain functions into a design?s hdl and allowing the synthesis tools to inference the use of a sysdsp block. ? the implementation of designs in the mathworks ? simulink ? tool using a lattice block set. the isplever sys- dsp portion of the isplever design tools will then convert these blocks in to hdl as appropriate. ? instantiation of sysdsp primitives directly in the source code targeting sysdsp bl ock using ipexpress ipexpress allows you to graphically specify sysdsp elements . once the element is specif ied, a hdl file is gener- ated, which can be instantiated in a design. ipexpress allows users to configure all ports and set all available parameters. the following modu les target the sysdsp block. for design examples usin g ipexpress, refer to exam- ples in the isplever software (from the pr oject navigator pull down-menu, go to file and open example ). the following four types of elements can be specified via ipexpress: ? mult (multiplier) ? mac (multiplier accumulate) ? multaddsub (multiplier add/subtract) ? multaddsubsum (multiply add/subtract and sum) mult module the mult module configures elements to be packed into the sysdsp primitiv es. the basic mode screen illustrated in figure 13-2 consists of an optional one clock, one clock enable and one reset tied to all registers. multiple sys- dsp blocks can be spanned to accommodate large multiplic ations. additional luts may be required if multiple sysdsp blocks are needed. select area/speed to determine the lut implementation. the input data format can be selected as parallel, shift or dynamic. the shift format can only be enabled if inputs are less than 18 bits. the shift format enables a sample/shift register, which is usef ul in applications such as the fir filter. the advanced mode screen, illustrated in fi gure 13-3, allows finer control over the re gister. in the advanced mode, users can control each register with independent clocks, clock enables and resets. mult inputs can be from 2 to 72 bits.
13-3 lattice semiconductor lattice xp2 sysdsp usage guide figure 13-2. mult mode basic set-up figure 13-3. mult mode advanced set-up
13-4 lattice semiconductor lattice xp2 sysdsp usage guide mac module the mac module configures multiply accumulate elements to be packed into the primitive mult18x18macb. the basic mode, shown in figure 13-4, consists of an optional one clock, one clock enable and one reset tied to all reg- isters. because of the accumulator, th e output register is automatically enabled. multiple sysdsp blocks can be spanned to accommodate large multiplications. the accumulator of the sysdsp block is 52 bits deep and addi- tional luts can be used if a larger accumulation is requ ired. if sysdsp blocks are spanned, additional lut logic may be required. select area/speed to determine the lut implementation. the input data format can be selected as parallel, shift or dynamic. the shift format can only be enabled if inputs are less than 18 bits. the shift format enables a sample/shift register. the accumsload loads the accumulator with the value from the ld port. this is required to initialize and load the first value of the accumulation. the advanced mode, shown in figure 13-5, allows finer control over the registers. in the advanced mode, users can control each register with independent clocks, clock enables and resets. mac inputs can be from 2 to 72 bits. figure 13-4. mac mode basic set-up
13-5 lattice semiconductor lattice xp2 sysdsp usage guide figure 13-5. mac mode advanced set-up multaddsub module the multaddsub gui configures multiplier addition/subtr action elements to be packed into the primitives mult18x18addsubb or mult9x9addsubb. the basic mode, shown in figure 13-6, consists of an optional one clock, one clock enable and one reset tied to all registers. multiple sysdsp blocks can be spanned to accom- modate large multiplications. if sysdsp blocks are spanned, additional lut logic may be required. select area/speed to determine the lut implementation. the input data format can be selected as parallel, shift or dynamic. the shift format can only be enabled if inputs are less than 18 bits. the shift format enables a sam- ple/shift register, which is useful in applications such as the fir filter. the advanced mode, shown in figure 13-7, provides finer control over the registers. in the advanced mode, users can control each register with independent clocks, clock enables and resets. multaddsub inputs can be from 2 to 72 bits.
13-6 lattice semiconductor lattice xp2 sysdsp usage guide figure 13-6. multaddsub mode basic set-up figure 13-7. multaddsub mode advanced set-up
13-7 lattice semiconductor lattice xp2 sysdsp usage guide multaddsubsum module the multaddsubsum gui configures multiplier addition/subtraction addition elements to be packed into the primitives mult18x18addsubsumb or mult9x9addsubsumb. the basic mode, shown in figure 13-8, con- sists of an optional one clock, one clock enable and one reset tied to all registers. multiple sysdsp blocks can be spanned to accommodate large multiplications. if sysdsp blocks are spanned, additional lut logic may be required. select area/speed to determine the lut implementation. the input data format can be selected as par- allel, shift or dynamic. the shift format is can only be enabled if inputs are less than 18 bits. the shift format enables a sample/shift register, which is useful in applicat ions such as the fir filter. the advanced mode, shown in figure 13-9, provides finer control over the registers. in the advanced mode, users can control each register with independent clocks, clock enables and resets. multaddsubsum inputs can be from 2 to 72 bits. figure 13-8. multaddsubsum mode basic set-up
13-8 lattice semiconductor lattice xp2 sysdsp usage guide figure 13-9. multaddsubsum mode advance figure 13-10. multaddsubsum mode advance
13-9 lattice semiconductor lattice xp2 sysdsp usage guide targeting the sysdsp block by inference the inferencing flow enables the design tools to infer sysdsp blocks from a hdl design. it is important to note that when using the inferencing flow, unle ss the code style matches the sysdsp block, results will not be optimal. con- sider the following verilog and vhdl examples: // this verilog example will be mapped into single mult18x18macb with the output register enabled module mult_acc (dataout, dataax, dataay, clk); output [16:0] dataout; input [7:0] dataax, dataay; input clk; reg [16:0] dataout; wire [15:0] multa = dataax * dataay; // 9x9 multiplier wire [16:0] adder_out; assign adder_out = multa + dataout; // accumulator always @(posedge clk) begin dataout <= adder_out; // output register of the accumulator end endmodule -- this vhdl example will be mapped into single mult18x18macb with all the registers enabled library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity mac is port (clk, reset : in std_logic; dataax, dataay : in std_logic_vector(8 downto 0); dataout : out std_logic_vector(17 downto 0)); end; architecture arch of mac is signal dataax_reg, dataay_reg : std_logic_vector(8 downto 0); signal multout, multout_reg : std_logic_vector(17 downto 0); signal addout : std_logic_vector(17 downto 0); signal dataout_reg : std_logic_vector(17 downto 0); begin dataout <= dataout_reg; process (clk, reset) begin if (reset = ?1?) then dataax_reg <= (others => ?0?); dataay_reg <= (others => ?0?); elsif (clk?event and clk=?1?) then dataax_reg <= dataax; dataay_reg <= dataay; end if; end process; multout <= dataax_reg * dataay_reg; process (clk, reset) begin if (reset = ?1?) then multout_reg <= (others => ?0?); elsif (clk?event and clk=?1?) then multout_reg <= multout; end if;
13-10 lattice semiconductor lattice xp2 sysdsp usage guide end process; addout <= multout_reg + dataout_reg; process (clk, reset) begin if (reset = ?1?) then dataout_reg <= (others => ?0?); elsif (clk?event and clk=?1?) then dataout_reg <= addout; end if; end process; end arch; the above rtl will infer the following block diagram: figure 13-11. mult18x18macb block diagram this block diagram can be mapped directly into the sysdsp primitives. note that if a test point were added between the multiplier and the accumulator, or two output registers, etc. the code could not be mapped into a mult18x18macb of a sysdsp block. theref ore, options that could be included in a design are input registers, pipeline registers, etc. fo r more inferring design examples refe r to examples in the isplever software. multiplier accumulator
13-11 lattice semiconductor lattice xp2 sysdsp usage guide figure 13-12. mac18x18macb packed into a sysdsp block sysdsp blocks in the report file to check the configuration of the sysdsp blocks in your design you can look at the map and post par report files. the map report file shows the mapped sysdsp components/primitives in your design. the post par report file shows the number of components in each sysdsp block. th e report files that follow show how the inferred mac was used. map report file . mult18x18macb addout_17_0: multiplier operation unsigned operation registers clk ce rst -------------------------------------------- input pipeline operation registers clk ce rst -------------------------------------------- input pipeline overflow1 accum1[51:0] overflow3 accum3[51:0] mui18a0[17:0] mui18b0[17:0] mui18a3[8:0] mui18b3[8:0] sroa[17:0]* srob[17:0]* clk[3:0]** ce[3:0]* rst[3:0]* notes: *these signals are optional. **at least one clock is required. sria[17:0]* srib[17:0]* 18x18 - 0 18x18 - 2 pipe 1 pipe 0 pipe 2 18x18 - 1 18x18 - 3 unused pipe 3 out reg 3 out reg 2 out reg 1 out reg 0 52-bit accum 3 52-bit accum 1 accumsload[3,1]* addnsub[3,1]* sourceb[3,1]* sourcea[3,1]* signeda[3,1]* signedb[3,1]* +/- +/- in reg a 2 in reg b 2 in reg a 3 in reg b 3 in reg a 0 in reg b 0 in reg a1 in reg b1 sload data1[15:0]* mui18a2[17:0] mui18b2[17:0] sload data3[15:0]* mui18a1[17:0] mui18b1[17:0]
13-12 lattice semiconductor lattice xp2 sysdsp usage guide addsub operation add operation registers clk ce rst -------------------------------------------- input pipeline data input registers clk ce rst --------------------------------------------- a clk0 ce0 rst0 b clk0 ce0 rst0 pipeline registers clk ce rst -------------------------------------------- pipe clk0 ce0 rst0 output register clk ce rst -------------------------------------------- output clk0 ce0 rst0 other gsr enabled number of mapped dsp components: -------------------------------- mult36x36b 0 mult18x18b 0 mult18x18macb 1 mult18x18addsubb 0 mult18x18addsubsumb 0 mult9x9b 0 mult9x9addsubb 0 mult9x9addsubsumb 0 -------------------------------- post par report file dsp utilization summary: dsp block #: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 # of mult36x36b # of mult18x18b # of mult18x18macb 1 # of mult18x18addsubb # of mult18x18addsubsumb # of mult9x9b # of mult9x9addsubb # of mult9x9addsubsumb dsp block 1 component_type instance_name dsp block 2 component_type instance_name dsp block 3 component_type instance_name dsp block 4 component_type instance_name dsp block 5 component_type instance_name dsp block 6 component_type instance_name dsp block 7 component_type instance_name dsp block 8 component_type instance_name dsp block 9 component_type instance_name r45c81 mult18x18macb addout_17_0 dsp block 10 component_type instance_name dsp block 11 component_type instance_name dsp block 12 component_type instance_name dsp block 13 component_type instance_name dsp block 14 component_type instance_name dsp block 15 component_type instance_name dsp block 16 component_type instance_name dsp block 17 component_type instance_name dsp block 18 component_type instance_name
13-13 lattice semiconductor lattice xp2 sysdsp usage guide targeting the sysdsp block using simulink simulink overview simulink is a graphical add-on (similar to schematic entry) for matlab ? , which is produced by the mathworks. for more information, refer to the simulink web page at www.mathworks.com/products/simulink/ . why is simulink used? ? it allows users to create algorithms using floating point numbers. ? it helps users convert floating point algorithms into fixed point algorithms. how does simulink fit into the normal isplever design flow? ? once you have converted have your algorithm working in fixed point. you can use the lattice ispdsp block to create hdl files, which can be instan tiated in your hdl design. currently there is only support for vhdl. what does lattice provide? ? lattice provides a library of blocks for the simulink to ol, which include multipliers, adders, registers, and other standard building blocks. besides the basic building blocks there are a couple of unique lattice blocks: gateways in and out everything between gateways in and out represents the hdl code. everything before a gateway in is the stim- ulus your test bench. everything after the gateway out are the si gnals you will be monitoring in the test bench. below is an example. the box on the left contains gateways in?s and the three boxes on the right contain gate- way outs in figure 13-13. generate the generate block is used to convert fixed point simulink design into hdl files which can be instantiated in a hdl design. the generate block is identified by the lattice logo and can be seen in figure 13-13.
13-14 lattice semiconductor lattice xp2 sysdsp usage guide figure 13-13. simulink design targeting the sysdsp block by instantiating primitives the sysdsp block can be targeted by instantiating the sysdsp block primitives into the design. the advantage of instantiating primitives is that it provides access to all ports and sets all available parameters. the disadvantage of this flow is that all this customizat ion requires extra coding by the user. appendix a details the syntax for the sys- dsp block primitives. sysdsp block control signal and data signal descriptions rst asynchronous reset of selected registers signeda dynamic signal: 0 = unsigned, 1 = signed signedb dynamic signal: 0 = unsigned, 1 = signed accumsload dynamic signal: 0 = accumulate, 1 = load addnsub dynamic signal: 0 = subtract, 1 = add sourcea dynamic signal: 0 = par allel input, 1 = shift input sourceb dynamic signal: 0 = par allel input, 1 = shift input technical support assistance hotline: 1-800-lattice (north america) +1-503-268-8001 (outside north america) e-mail: techsupport@latticesemi.com internet: www.latticesemi.com
13-15 lattice semiconductor lattice xp2 sysdsp usage guide revision history date version change summary february 2007 01.0 initial release.
13-16 lattice semiconductor lattice xp2 sysdsp usage guide appendix a. dsp block primitives mult18x18b input a17,a16,a15,a14,a13,a12,a11,a10,a9,a8,a7,a6,a5,a4,a3,a2,a1,a0; input b17,b16,b15,b14,b13,b12,b11,b10,b9,b8,b7,b6,b5,b4,b3,b2,b1,b0; input signeda, signedb, sourcea, sourceb; input ce0,ce1,ce2,ce3,clk0,clk1,clk2,clk3,rst0,rst1,rst2,rst3; input sria17,sria16,sria15,sria14,sria13,sria12,sria11,sria10,sria9; input sria8,sria7,sria6,sria5,sria4,sria3,sria2,sria1,sria0; input srib17,srib16,srib15,srib14,srib13,srib12,srib11,srib10,srib9; input srib8,srib7,srib6,srib5,srib4,srib3,srib2,srib1,srib0; output sroa17,sroa16,sroa15,sroa14,sroa13,sroa12,sroa11,sroa10,sroa9; output sroa8,sroa7,sroa6,sroa5,sroa4,sroa3,sroa2,sroa1,sroa0; output srob17,srob16,srob15,srob14,srob13,srob12,srob11,srob10,srob9; output srob8,srob7,srob6,srob5,srob4,srob3,srob2,srob1,srob0; output p35,p34,p33,p32,p31,p30,p29,p28,p27,p26,p25,p24,p23,p22,p21,p20,p19,p18; output p17,p16,p15,p14,p13,p12,p11,p10,p9,p8,p7,p6,p5,p4,p3,p2,p1,p0; parameter reg_inputa_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb_ce = = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_output_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_output_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_output_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signeda_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signedb_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_rst = ? rst0, rst1, rst2, rst3 ?; parameter gsr = ? enabled, disabled ?; mult18x18addsubb input a017,a016,a015,a014,a013,a012,a011,a010,a09; input a08,a07,a06,a05,a04,a03,a02,a01,a00; input a117,a116,a115,a114,a113,a112,a111,a110,a19; input a18,a17,a16,a15,a14,a13,a12,a11,a10; input b017,b016,b015,b014,b013,b012,b011,b010,b09; input b08,b07,b06,b05,b04,b03,b02,b01,b00; input b117,b116,b115,b114,b113,b112,b111,b110,b19; input b18,b17,b16,b15,b14,b13,b12,b11,b10; input signeda, signedb, sourcea0, sourcea1, sourceb0, sourceb1, addnsub; input ce0,ce1,ce2,ce3,clk0,clk1,clk2,clk3,rst0,rst1,rst2,rst3; input sria17,sria16,sria15,sria14,sria13,sria12,sria11,sria10,sria9; input sria8,sria7,sria6,sria5,sria4,sria3,sria2,sria1,sria0; input srib17,srib16,srib15,srib14,srib13,srib12,srib11,srib10,srib9; input srib8,srib7,srib6,srib5,srib4,srib3,srib2,srib1,srib0; output sroa17,sroa16,sroa15,sroa14,sroa13,sroa12,sroa11,sroa10,sroa9; output sroa8,sroa7,sroa6,sroa5,sroa4,sroa3,sroa2,sroa1,sroa0; output srob17,srob16,srob15,srob14,srob13,srob12,srob11,srob10,srob9; output srob8,srob7,srob6,srob5,srob4,srob3,srob2,srob1,srob0; output sum36,sum35,sum34,sum33,sum32,sum31,sum30,sum29,sum28,sum27,sum26,sum25,sum24,sum23,sum22,sum21,su m20,sum19,sum18,sum17,sum16,sum15,sum14,sum13,sum12,sum11,sum10,sum9,sum8,sum7,sum6,sum5,sum4,sum3 ,sum2,sum1,sum0;
13-17 lattice semiconductor lattice xp2 sysdsp usage guide parameter reg_inputa0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputa1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_output_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_output_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_output_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signeda_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signeda_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signedb_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signedb_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter gsr = ? enabled, disabled ?; mult18x18addsubsumb input a017,a016,a015,a014,a013,a012,a011,a010,a09; input a08,a07,a06,a05,a04,a03,a02,a01,a00; input a117,a116,a115,a114,a113,a112,a111,a110,a19; input a18,a17,a16,a15,a14,a13,a12,a11,a10; input a217,a216,a215,a214,a213,a212,a211,a210,a29; input a28,a27,a26,a25,a24,a23,a22,a21,a20; input a317,a316,a315,a314,a313,a312,a311,a310,a39; input a38,a37,a36,a35,a34,a33,a32,a31,a30; input b017,b016,b015,b014,b013,b012,b011,b010,b09; input b08,b07,b06,b05,b04,b03,b02,b01,b00; input b117,b116,b115,b114,b113,b112,b111,b110,b19; input b18,b17,b16,b15,b14,b13,b12,b11,b10; input b217,b216,b215,b214,b213,b212,b211,b210,b29; input b28,b27,b26,b25,b24,b23,b22,b21,b20; input b317,b316,b315,b314,b313,b312,b311,b310,b39; input b38,b37,b36,b35,b34,b33,b32,b31,b30; input signeda, signedb,addnsub1,addnsub3; input sourcea0, sourcea1, sourcea2, sourcea3; input sourceb0, sourceb1, sourceb2, sourceb3;
13-18 lattice semiconductor lattice xp2 sysdsp usage guide input ce0,ce1,ce2,ce3,clk0,clk1,clk2,clk3,rst0,rst1,rst2,rst3; input sria17,sria16,sria15,sria14,sria13,sria12,sria11,sria10,sria9; input sria8,sria7,sria6,sria5,sria4,sria3,sria2,sria1,sria0; input srib17,srib16,srib15,srib14,srib13,srib12,srib11,srib10,srib9; input srib8,srib7,srib6,srib5,srib4,srib3,srib2,srib1,srib0; output sroa17,sroa16,sroa15,sroa14,sroa13,sroa12,sroa11,sroa10,sroa9; output sroa8,sroa7,sroa6,sroa5,sroa4,sroa3,sroa2,sroa1,sroa0; output srob17,srob16,srob15,srob14,srob13,srob12,srob11,srob10,srob9; output srob8,srob7,srob6,srob5,srob4,srob3,srob2,srob1,srob0; output sum37,sum36,sum35,sum34,sum33,sum32,sum31,sum30,sum29,sum28,sum27,sum26,sum25,sum24,sum23,sum22,su m21,sum20,sum19,sum18,sum17,sum16,sum15,sum14,sum13,sum12,sum11,sum10,sum9,sum8,sum7,sum6,sum5,sum 4,sum3,sum2,sum1,sum0; parameter reg_inputa0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputa1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputa2_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa2_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa2_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputa3_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa3_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa3_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb2_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb2_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb2_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb3_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb3_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb3_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline2_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline2_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline2_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline3_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline3_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline3_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_output_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_output_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_output_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signeda_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signeda_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signedb_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_0_rst = ? rst0, rst1, rst2, rst3 ?;
13-19 lattice semiconductor lattice xp2 sysdsp usage guide parameter reg_signedb_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub1_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub1_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub1_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub1_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub1_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub1_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub3_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub3_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub3_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub3_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub3_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub3_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter gsr = ? enabled, disabled ?; mult18x18macb input a17,a16,a15,a14,a13,a12,a11,a10,a9; input a8,a7,a6,a5,a4,a3,a2,a1,a0; input b17,b16,b15,b14,b13,b12,b11,b10,b9; input b8,b7,b6,b5,b4,b3,b2,b1,b0; input addnsub, signeda, signedb,accumsload; input sourcea, sourceb; input ce0,ce1,ce2,ce3,clk0,clk1,clk2,clk3,rst0,rst1,rst2,rst3; input ld51, ld50, ld49, ld48, ld47, ld46, ld45, ld44, ld43, ld42, ld41, ld40 input ld39, ld38, ld37, ld36, ld35, ld34, ld33, ld32, ld31, ld30 input ld29, ld28, ld27, ld26, ld25, ld24, ld23, ld22, ld21, ld20 input ld19, ld18, ld17, ld16, ld15, ld14, ld13, ld12, ld11, ld10 input ld9, ld8, ld7, ld6, ld5, ld4, ld3, ld2, ld1, ld0; input sria17,sria16,sria15,sria14,sria13,sria12,sria11,sria10,sria9; input sria8,sria7,sria6,sria5,sria4,sria3,sria2,sria1,sria0; input srib17,srib16,srib15,srib14,srib13,srib12,srib11,srib10,srib9; input srib8,srib7,srib6,srib5,srib4,srib3,srib2,srib1,srib0; output sroa17,sroa16,sroa15,sroa14,sroa13,sroa12,sroa11,sroa10,sroa9; output sroa8,sroa7,sroa6,sroa5,sroa4,sroa3,sroa2,sroa1,sroa0; output srob17,srob16,srob15,srob14,srob13,srob12,srob11,srob10,srob9; output srob8,srob7,srob6,srob5,srob4,srob3,srob2,srob1,srob0; output accum51,accum50,accum49,accum48,accum47,accum46,accum45,accum44,accum43,accum42,accum41,accum40,ac cum39,accum38,accum37,accum36,accum35,accum34,accum33,accum32,accum31,accum30,accum29,accum28,accu m27,accum26,accum25,accum24,accum23,accum22,accum21,accum20,accum19,accum18,accum17,accum16,accum1 5,accum14,accum13,accum12,accum11,accum10,accum9,accum8,accum7,accum6,accum5,accum4,accum3,accum2, accum1,accum0,overflow; parameter reg_inputa_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_output_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_output_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_output_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signeda_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_1_ce = ? ce0, ce1, ce2, ce3 ?;
13-20 lattice semiconductor lattice xp2 sysdsp usage guide parameter reg_signeda_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signedb_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signedb_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_accumsload_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_accumsload_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_accumsload_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_accumsload_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_accumsload_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_accumsload_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter gsr = ? enabled, disabled ?; mult36x36b input a35,a34,a33,a32,a31,a30,a29,a28,a27,a26,a25,a24,a23,a22,a21,a20,a19,a18; input a17,a16,a15,a14,a13,a12,a11,a10,a9,a8,a7,a6,a5,a4,a3,a2,a1,a0; input b35,b34,b33,b32,b31,b30,b29,b28,b27,b26,b25,b24,b23,b22,b21,b20,b19,b18; input b17,b16,b15,b14,b13,b12,b11,b10,b9,b8,b7,b6,b5,b4,b3,b2,b1,b0; input signeda, signedb; input ce0,ce1,ce2,ce3,clk0,clk1,clk2,clk3,rst0,rst1,rst2,rst3; output p71,p70,p69,p68,p67,p66,p65,p64,p63,p62,p61,p60,p59,p58,p57,p56,p55,p54; output p53,p52,p51,p50,p49,p48,p47,p46,p45,p44,p43,p42,p41,p40,p39,p38,p37,p36; output p35,p34,p33,p32,p31,p30,p29,p28,p27,p26,p25,p24,p23,p22,p21,p20,p19,p18; output p17,p16,p15,p14,p13,p12,p11,p10,p9,p8,p7,p6,p5,p4,p3,p2,p1,p0; parameter reg_inputa_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_output_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_output_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_output_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signeda_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signeda_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signedb_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signedb_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter gsr = ? enabled, disabled ?;
13-21 lattice semiconductor lattice xp2 sysdsp usage guide mult9x9b input a8,a7,a6,a5,a4,a3,a2,a1,a0; input b8,b7,b6,b5,b4,b3,b2,b1,b0; input signeda, signedb, sourcea, sourceb; input ce0,ce1,ce2,ce3,clk0,clk1,clk2,clk3,rst0,rst1,rst2,rst3; input sria8,sria7,sria6,sria5,sria4,sria3,sria2,sria1,sria0; input srib8,srib7,srib6,srib5,srib4,srib3,srib2,srib1,srib0; output sroa8,sroa7,sroa6,sroa5,sroa4,sroa3,sroa2,sroa1,sroa0; output srob8,srob7,srob6,srob5,srob4,srob3,srob2,srob1,srob0; output p17,p16,p15,p14,p13,p12,p11,p10,p9,p8,p7,p6,p5,p4,p3,p2,p1,p0; parameter reg_inputa_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_output_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_output_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_output_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signeda_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signedb_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_rst = ? rst0, rst1, rst2, rst3 ?; parameter gsr = ? enabled, disabled ?; mult9x9addsubb input a08,a07,a06,a05,a04,a03,a02,a01,a00; input a18,a17,a16,a15,a14,a13,a12,a11,a10; input b08,b07,b06,b05,b04,b03,b02,b01,b00; input b18,b17,b16,b15,b14,b13,b12,b11,b10; input signeda, signedb,addnsub; input sourcea0, sourcea1, sourceb0, sourceb1; input ce0,ce1,ce2,ce3,clk0,clk1,clk2,clk3,rst0,rst1,rst2,rst3; input sria8,sria7,sria6,sria5,sria4,sria3,sria2,sria1,sria0; input srib8,srib7,srib6,srib5,srib4,srib3,srib2,srib1,srib0; output sroa8,sroa7,sroa6,sroa5,sroa4,sroa3,sroa2,sroa1,sroa0; output srob8,srob7,srob6,srob5,srob4,srob3,srob2,srob1,srob0; output sum18,sum17,sum16,sum15,sum14,sum13,sum12,sum11,sum10,sum9,sum8,sum7,sum6,sum5,sum4,sum3,sum2,sum1 ,sum0; parameter reg_inputa0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputa1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline0_rst = ? rst0, rst1, rst2, rst3 ?;
13-22 lattice semiconductor lattice xp2 sysdsp usage guide parameter reg_pipeline1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_output_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_output_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_output_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signeda_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signeda_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signedb_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signedb_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter gsr = ? enabled, disabled ?; mult9x9addsubsumb input a08,a07,a06,a05,a04,a03,a02,a01,a00; input a18,a17,a16,a15,a14,a13,a12,a11,a10; input a28,a27,a26,a25,a24,a23,a22,a21,a20; input a38,a37,a36,a35,a34,a33,a32,a31,a30; input b08,b07,b06,b05,b04,b03,b02,b01,b00; input b18,b17,b16,b15,b14,b13,b12,b11,b10; input b28,b27,b26,b25,b24,b23,b22,b21,b20; input b38,b37,b36,b35,b34,b33,b32,b31,b30; input signeda, signedb,addnsub1,addnsub3; input sourcea0, sourcea1, sourcea2, sourcea3; input sourceb0, sourceb1, sourceb2, sourceb3; input ce0,ce1,ce2,ce3,clk0,clk1,clk2,clk3,rst0,rst1,rst2,rst3; input sria8,sria7,sria6,sria5,sria4,sria3,sria2,sria1,sria0; input srib8,srib7,srib6,srib5,srib4,srib3,srib2,srib1,srib0; output sroa8,sroa7,sroa6,sroa5,sroa4,sroa3,sroa2,sroa1,sroa0; output srob8,srob7,srob6,srob5,srob4,srob3,srob2,srob1,srob0; output sum19,sum18,sum17,sum16,sum15,sum14,sum13,sum12,sum11,sum10,sum9,sum8,sum7,sum6,sum5,sum4,sum3,sum 2,sum1,sum0; parameter reg_inputa0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputa1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputa2_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa2_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa2_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputa3_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputa3_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputa3_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb0_rst = ? rst0, rst1, rst2, rst3 ?;
13-23 lattice semiconductor lattice xp2 sysdsp usage guide parameter reg_inputb1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb2_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb2_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb2_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_inputb3_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_inputb3_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_inputb3_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline2_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline2_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline2_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_pipeline3_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_pipeline3_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_pipeline3_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_output_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_output_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_output_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signeda_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signeda_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signeda_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signeda_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signedb_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_signedb_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_signedb_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_signedb_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub1_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub1_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub1_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub1_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub1_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub1_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub3_0_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub3_0_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub3_0_rst = ? rst0, rst1, rst2, rst3 ?; parameter reg_addnsub3_1_clk = ? none, clk0, clk1, clk2, clk3 ?; parameter reg_addnsub3_1_ce = ? ce0, ce1, ce2, ce3 ?; parameter reg_addnsub3_1_rst = ? rst0, rst1, rst2, rst3 ?; parameter gsr = ? enabled, disabled ?;
www.latticesemi.com 14-1 tn1141_01.6 june 2009 technical note tn1141 ? 2009 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. introduction the memory in the latticexp2? fpgas is built using flas h cells, along with sram cells, so that configuration memory can be loaded automatically at power-up, or at an y time the user wishes to update the device. in addition to ?instant-on? capability, on- chip flash memory greatly incr eases design security by getting rid of the external con- figuration bitstream; while maintaining the ease of use and reprogrammability of an sram-based fpga. the latticexp2 supports the use of an encryption key to protect the contents of the flash memory for additional security. the latticexp2 also supports the use of a on e-time-programmable (otp) feature to protect the flash memory from being erased or re-programmed. while an external device is not required, the latticexp2 does support several external configuration modes. the available external configuration modes are: ? slave spi ? master spi ? ispjtag? (1149.1 interface) this guide will cover all the configuration options ava ilable for the latticexp2. programming overview the latticexp2 contains two types of memory, sram and fl ash (refer to figure 14-1). sram contains the fpga configuration, essentially the ?fuses? that define the circuit connections; flash provides an internal storage space for the configuration data. the latticexp2 also contains additional flash memory area and that is designated for tag memory and user flash memory. the tag memory is a scratch pad memory that is available to the user for storage of mission critical data, board serialization, revision information, programmed patt ern identification, or other information. the user flash memory is available to provide a back up the contents of the ebr ram modules if the user desires. these func- tions will be discussed in more detail in later sections of this document. the sram can be configured using jtag, the external master spi port, or by using the data stored in on-chip flash. the configuration process consists of sram initia lization (clear the ram and the address pointers), loading the sram with the configuration data, and setting the fpga into user mode (waking up the fpga). on-chip flash can be programmed by using jtag or by using the external slave spi port. jtag flash program- ming can be performed any time the device is powered up. the slave spl port uses the sysconfig? pins and can program the flash directly or in the background. direct programming takes place during config mode, back- ground programming during user mode. the fpga enters config mode at power up, when the programn pin is pulled low, or when a refresh command is issued via jtag; it enters user mode when it wakes up, i.e. when the device begins running user code. these two programming modes, direct and ba ckground, will be referred to in this document as flash direct and flash background. latticexp2 sysconfig usage guide
14-2 lattice semiconductor latticex p2 sysconfig usage guide figure 14-1. programming block diagram configuration pins the latticexp2 has one dedicated and nine dual-purpose sysconfig pins. the dual-purpose pins are available as extra i/o pins if they are not used for configuration. the configuration mode pins , along with a programmable option, contro ls how the latticexp2 will be configured. the configuration mode pins (cfg[1:0]) are generally hard wired on the pcb and determine which configuration mode will be used; the programm able option is accessed via preferences in lattice isplever ? design software, or as hdl source file attributes, and allows the user to prot ect the configuration pins from accidental use by the user or the place-and-route software. the latticexp2 devices also support ispjtag for configuration, including trans- parent readback, and for jtag testing. the following sections describe the functionality of the sysconfig and jtag pins. note that jtag and ispjtag will be used inte rchangeably in this document. table 14-1 is provided for reference. table 14-1. configuration pins for the latticexp2 device 1 pin name i/o type pin type mode used cfg0 input, weak pull-up dedicated all cfg1 input, weak pull-up dual-purpose 2 mspi, sspi programn input, weak pull-up dual-purpose 2 mspi, sspi initn bi-directional open drain, weak pull-up dual-purpose 2 mspi, sspi done bi-directional open drain with weak pull-up or active drive dual-purpose 2 mspi, sspi cclk input or output dual-purpose mspi, sspi sispi input or output dual-purpose mspi, sspi sospi input or output dual-purpose mspi, sspi csspisn input, weak pull- up dual-purpose slave spi csspin output, tri-state, weak pull-up dual-purpose master spi tdi input, weak pull-up jtag tdo output jtag tck input with hysteresis jtag ispjtag 1149.1 tap sysconfig port flash memory space jtag 1532 master spi slave spi sram memory space port mode memory space program in seconds program in milliseconds program in microseconds sdm
14-3 lattice semiconductor latticex p2 sysconfig usage guide sysconfig pins following is a description of the sysconfig pins for the la tticexp2 device. these pins are used to control or mon- itor the configuration process. these pins are used for non-jtag pr ogramming sequences only. the jtag pins will be explained later in the ispjtag pins section of this document. cfg[1:0] the configuration mode pin cfg0 is a dedicated input with a weak pull-up. the cfg1 pin is a dual-purpose input pin with a weak pull-up. the cfg pins are used to select the configuration mode for the latticexp2, i.e. what type of device the latticexp2 will configure from. at power-on-reset (por), or wh en the programn pin is driven low, the device will enter the configuration mode selected by the cfg[1:0] pins. table 14-2. latticexp2 configuration modes when the cfg0 pin is high, the device will configure itself by reading the data stored in on-chip flash; this is referred to as sdm, or self download mode. see the self-download section of this document for more information regarding sdm. if the cfg0 pin is lo w then the device will read the cfg1 pin to determine which mode to enter. when cfg1 is low the device will first attempt to configure the sram using master spi mode with the external spi flash port. if this fails then the device will configure itself from the on-chip flash if a conf iguration file is stored there. when cfg1 is high the device will first attempt to configure the sram using on-c hip flash. if a configuration file is not stored there then the devi ce will configure itself using master spi mode with the external spi flash port. dual-purpose sysconfig pins the following is a list of the dual-purpose sysconfig pins . these pins are available as general purpose i/o after configuration. if a dual-purpose pin is to be used both for configuration and as a general purpose i/o the user must adhere to the following: ? the i/o type must remain the same. in other words, if the pin is a 3.3v cmos pin (lvcmos33) during configura- tion it must remain a 3.3v cmos pin as a gpio. ? the persistent option must be set to off. the persist ent option will be set to off by the software unless the user sets the slave_spi_port to enable using the desi gn planner in isplever. this option is shown in the global tab of the design planner speadsheet view. ? the user is responsible for insuring that no internal or external logic will interfer e with device configuration. after configuration these pins, if not used as gpio, are tri-stated and weakly pulled up. tms input, weak pull-up jtag 1. weak pull-ups consist of a current source of 30ua to 150ua. the pull-up for cfg tracks v cc (core). this means that any voltage level above v cc is considered a ?high.? the pull-ups for tdi and tms track v ccj ; all other pull-ups track the v ccio for that pin. 2. this pin becomes a dedicated progra mming pin when the cfg0 pin is low. configuration mode cfg[1] cfg[0] spi flash boot 0 0 dual-boot mode 1 0 self download mode (sdm) x 1 table 14-1. configuration pins for the latticexp2 device (continued) 1 pin name i/o type pin type mode used
14-4 lattice semiconductor latticex p2 sysconfig usage guide cfg1 the cfg1 pin is a dual-purpose input with a weak pull-up. its function is described in the section above. when the cfg0 pin is high, the cfg1 pin is not used for configur ation and becomes a general purpose i/o pin available to the user. programn the programn pin is a dual-purpose input with a weak pull-up. this pin is used to initiate a non-jtag sram configuration sequence. a high to low signal applied to programn sets the device into configuration mode. the programn pin can be used to trigger configuration at any time. if the device is using jtag then programn will be ignored until the device is released from jtag mode. the programn pin is only available if the cfg0 pin is set to 0 (not in sdm mode). when the cfg0 pin is set to 1 then programn becomes a general purpose i/o pin available to the user. when the cfg0 pin is set to 0, the programn pin becomes a dedicated programming pin. initn the initn pin is a dual-purpose bi-directional open drain pi n with a weak pull-up. initn is capable of driving a low pulse out as well as detecting a low pulse driven in. when using either the spi flash boot or embedded flash boot mode to configure the sram, initn going low indi- cates that the sram is being initialized; initn going high indicates that the fpga is ready to accept configuration data. to delay configuration the initn pin can be held low externally. the devi ce will not enter c onfiguration mode as long as the initn pin is held low. after configuration has started initn is used to indicate a bitstream error. the initn pin will be driven low if the calculated crc and th e configuration data crc do not match; done will then remain low and the latt icexp2 will not wake up. when using sdm, configuration from on-chi p flash initn is not used or monitored. when programming on-chip flash the initn pin is not us ed. during flash direct programming an error will prevent the fpga from configuring from the flash, during flash backgr ound programming an error will not affect the con- figuration already running in sram. the initn pin is only available if the cfg0 pin is set to 0 (not in sdm mode). when the cfg0 pin is set to 1 then initn becomes a general purpose i/o pin available to the user. when the cfg0 pin is set to 0, the initn pin becomes a dedicated programming pin. done the done pin is a dual-purpose bi-directional open drain wi th a weak pull-up (default), or an actively driven pin. done will be driven low when the device is in configuration mo de and the internal done bit is not programmed. when the initn and programn pins go high, and the in ternal done bit is programmed, the done pin will be released (or driven high, if it is an actively driven pin). the done pin can be held low externally and, depending on the wake-up sequence selected, the device will not become functional until the done pin is externally brought high. reading the done bit is a good way for an external device to tell if the fpga is configured. when using jtag to configure sram the done pin is driven by the boundary scan cell, so the state of the done pin has no meaning until configuration is completed. the done pin is only available if the cfg0 pin is set to 0 (not in sdm mode). when the cfg0 pin is set to 1 then done becomes a general purpose i/o pin available to the user. when the cfg0 pin is set to 0, the done pin becomes a dedicated programming pin.
14-5 lattice semiconductor latticex p2 sysconfig usage guide cclk cclk is a dual-purpose bi-directional pin; direction depends on whether a master or slave mode is selected. if a master mode is selected , the cclk pin will become an output pi n; otherwise cclk is an input pin. if the cclk pin becomes an output, the internal programmab le oscillator is connected to the cclk and is driven out to slave devices. cclk will stop 100 to 500 clock cyc les after the done pin is br ought high and the device wake-up sequence completed. the extra clock cycles ensure that enough clocks are provided to wake-up other devices in the chain. when stopped, cclk becomes an input (tri-state d output). cclk will restart (become an out- put) on the next configuration initialization sequence. csspin the csspin pin is a dual-purpose output pin with a weak pull-up. the csspin is an active low chip select to an external spi flash when used with t he master spi mode. the csspin pin beco mes a dedicated pin if the cfg0 pin is set to 0 (not in sdm mo de). when the cfg0 pin is set to 1 then csspin becomes a gene ral purpose i/o pin available to the user. if the cfg0 is set to 0 then this pin should be driven high unless the master spi mode is selected to avoid conten- tion between the master and slave spi modes. csspisn the csspisn pin is a dual-purpo se input pin with a weak pu ll-up. the csspisn is an acti ve low chip select to the internal spi interface and is used with the slave spi mode. if the csspisn is driven low while in th e middle of master spi port activity the master spi shall be disabled and the slave spi interface activated. the persistent prefer ence must be set to on in or der to preserve this pin as csspisn and allow access to the slave spi interface. the persistent preference will be set by the software automatically when the user sets the slave_spi_port option in the design planner. sispi the sispi pin is a dual-purpose bi-directional pin; direction depends upon whether a master or slave mode is active. the sispi is the input data pin when using the slave spi mode and is the output data pin when using the master spi mode. the persistent preference must be set to on in order to preserve this pin as sispi and allow access to the slave spi interface. the persistent preference will be set by the software automatically when the user sets the slave_spi_port option in the design planner. sospi the sospi pin is a dual-purpose bi-directional pin; direction depends upon whether a master or slave mode is active. the sospi is the input data pin when using the master spi mode and is the output data pin when using the slave spi mode. the persistent preference must be set to on in order to preserve this pin as sospi and allow access to the slave spi interface. the persistent preference will be set by the software automatically when the user sets the slave_spi_port option in the design planner.
14-6 lattice semiconductor latticex p2 sysconfig usage guide table 14-3. flash programming mode pin usage table 14-4. memory access modes external spi flash when the master spi mode is used for configuration an external spi flash device is required to hold the configura- tion data. the size of the bitstream and the required external spi flash is shown in table 14-5. table 14-5. maximum configuration bits flash programming mode direct background direct background port 6 slave spi ispjtag 1 pins cclk, csspisn, sispi, sospi tap user i/o states tristate user bscan user programn ? keep at high keep at high 2 initn pass/fail pass/fail not used 3 done done not used keep at high 4 slave_spi_port preference don?t care t5 enable 5 don?t care 1. ispjtag can be used to program the flas h regardless of the state of the cfg pins. 2. the state of the programn pin is ignored by the device duri ng jtag flash programming but the pin should be held high as a low will cause a configuration failure. when the devi ce is in the sdm mode, the programn pin is a dedicated i/o pin so it does not affec t config- uration. 3. the state of the initn pin is ignored by the device during jt ag flash programming but the pin should be allowed to float high using the internal pull-up. when the device is in the sdm mode, the initn pin is a dedicated i/o pin so it does not affect configuration. 4. the state of the done pin is ignored by the device during jt ag flash programming but the pin should be allowed to float high using the internal pull-up as a low can keep the devi ce from waking up. when the device is in the sdm mode, the done pin is a dedicated i /o pin so it does not affect configuration. 5. the slave_spi_port preference must be set to enable to use the slave spi port after the device has been configured. the slave spi port is also available when the device is not configured. 6. the master spi port can only be used to configure the sram in direct mode from an external spi flash memory. the cfg pins mus t be set per table 14-2 to enable this mode. mode flash sram read write read write slave spi yes 2 ye s 1 ye s n o master spi no no no yes 3 1. slave spi mode can only write to on-chip fl ash memory in background mode unless the flash memory is erased. 2. slave spi mode can read from on-chip flash memory in background mode only. 3. master spi mode can write to sram in direct mode only. density bitstream size (mb) spi flash (mb) xp2-5 1.27 2 xp2-8 1.99 2 xp2-17 3.54 4 xp2-30 5.79 8 xp2-40 8.03 16
14-7 lattice semiconductor latticex p2 sysconfig usage guide programming sequence there are two types of programming, sram, and flash background. this section goes through the process for each showing how the dedicated pins are used. sram when not using sdm (self download mode, on-chip flash) to program the sram, the sequence begins when the internal power-on reset (por) is released or the programn pin is driven low (see figure 14-2). the latticexp2 then drives initn low, tri-states the i /os, and initializes the intern al sram and control logic. when this is complete, if programn is high, initn will be released. if initn is he ld low externally the latticexp2 will wait until it goes high. when initn goes high the latticexp2 begins looking for the configuration data using the internal flash mem- ory or the master spi port, as determined by the cfg pins. if the cfg1 pin is high and the flash done bit is set (ind icating that the on-chip flash memory is programmed) then the latticexp2 will boot from the on-chip flash memory. if the flash done bit is not set then the latticexp2 will boot from the external spi flash memory using the master spi mode. if the cfg1 pin is low then the latticexp2 will boot from the external spi flash memo ry using the master spi mode. in the event of an erro r the latticexp2 will boot from the on-chip fl ash memory if the flash done bit is set. once configuration is complete the internal done bit is set, the done pin goes high, and the fpga wakes up (enters user mode). if a crc error is de tected when readin g the bitstream initn will go low, the internal done bit will not be set, the done pin will stay low, and the latticexp2 will not wake up. when using sdm to program sram the sequence is similar but initn is not used or monitored. the sequence begins when the internal power-on reset (por) is released. the latticexp2 then tri-states the i/os and initializes the internal sram and control logic. when initialization is complete the latticexp2 begins loading configuration data from on-chip flash. when using sdm, if the flash has been programmed, then the configuration sequence will proce ed using the data in on-chip flash. if the flash has no t been programmed, the c onfiguration sequence will st op. once the flash has been programmed, a por or jtag refresh instruction must occur to restart the configuration sequence. when using sdm, once configuration is complete, the internal done bit is set and the fpga wakes up (enters user mode). the external done pin is not available when using sdm configuration. figure 14-2. sram configuration timing diagram flash background flash background programming is possible using the slave spi port when it is enabled. the slave spi port can be enabled in the sdm mode as well as the spi mode. flash background will not disturb the fpga's present configu- ration in sram. initialize configure wake-up cclk programn initn done
14-8 lattice semiconductor latticex p2 sysconfig usage guide flash background programming may be used in both config mode and user mode (done bit = 0 or 1). to support flash background programming in user mode the slave_spi_port preference must be set to enable. when the csspisn pin goes low, the fpga will wait for the preamble and then look for the proper commands. a low on initn indicates an error during a flash erase or program. data is written and read on the sispi and sospi pins. after programming the flash the user may toggle the programn pin to transfer the flash data to sram if the spi mode is being used. if the sdm mode is being us ed then the sram will be upda ted on the next power up sequence of when a refr esh instruction is issued. if the csspisn pin is driven low, the csspin should be dr iven high and cclk maintain ed as an input to prevent activating the master spi interface. this will avoid c ontention between th e master and slave spi interfaces. ispjtag pins the ispjtag pins are standard ieee 11 49.1 tap (test access port) pins. the ispjtag pins are de dicated pins and are always accessible when the latticexp2 device is powered up. when programming the sram via ispjtag the dedicated programming pins, such as done, cannot be us ed to determine programming progress. this is because the state of the boundary scan cell w ill drive the pin, per jtag 1149.1, ra ther than normal internal logic. tdo the test data output pin is used to shift out serial test instructions and data. when tdo is not being driven by the internal circuitry, the pin will be in a high im pedance state. tdi the test data input pin is used to shift in serial test instructions and data. an internal pull-up resistor on the tdi pin is provided. the internal resistor is pulled up to v ccj. tms the test mode select pin cont rols test operations on the tap controller. on the falling edge of tck, depending on the state of tms, a tran sition will be made in the tap controller state ma chine. an internal pu ll-up resistor on the tms pin is provided. the internal resistor is pulled up to v ccj. tck the test clock pin, tck, provides the clock to run the tap controller, which loads and unloads the data and instruc- tion registers. tck can be stopped in either the high or low state and can be clocked at frequencies up to the fre- quency indicated in the device data sheet. the tck pin su pports the value is shown in the dc parameter table of the data sheet. the tck pin does not have a pull-up. a pull-down on the pcb of 4.7 k is recommended to avoid inadvertent clocking of the tap controller as v cc ramps up. vccj jtag v cc (v ccj ) supplies independent power to the jtag port to allow chaining with other jtag devices at a com- mon voltage. v ccj must be connected even if jtag is not used. this voltage may also power the jtag download cable. valid voltage levels are 3.3v, 2.5v, 1.8v, 1.5v, and 1.2v. please see in-system programming design gu idelines for ispjtag devices for further information. configuration and jtag voltage levels all of the control pins and programming pins default to lvcmos. the cfg0 pin is linked to v cc (core); tck, tdi, tdo, and tms track v ccj ; all other pins track the v ccio for that pin.
14-9 lattice semiconductor latticex p2 sysconfig usage guide configuration modes and options the latticexp2 device supports two co nfiguration modes, utilizing the spi port or self-configuration. on power up, or upon driving the programn pin low depending upon the current mode, the cfg[1:0] pins are sampled to determine the mode that will be used to configure the latticexp2 device. the cfg pins are gene rally hard wired on the pcb and determine how the device will retrieve its c onfiguration data. the slave_ spi_port preference is a programmable option which can be set using the design planner in lattice isplever design software, or as hdl source file attributes, and allow the user to protect the configuration pins from accidental use by the user or the place-and-route software. configuration options several configuration options are available for each configuration mode. ? when using a master clock, the master clock frequency can be set. ? a security bit is provided to prevent sram or flash readback. by setting the proper parameters in the lattice isplever design software the selected configur ation options are set in the generated bitstream. as the bitstream is loaded into the device the selected configuration options take effect. these options are described in the following sections. master clock if the latticexp2 is a master device the cclk pin will beco me an output with the freq uency set by the user. the default master clock frequency is 2.5 mhz. the software default adjusts the mclk frequency to 3.1 mhz in the programming bitstream. the user can determine the master clock frequency by setting the mcclk_freq. one of the first things loaded during configuration is the mcclk_freq parameter; once this parameter is loaded the frequency changes to the selected value using a glitchless switch. care should be exercised not to exceed the frequency specification of the slave devices or the signal integr ity capabilities of the pcb layout. the mcclk frequency selections made by the user are only valid if the latticexp2 device is booted from external spi flash. the internal flash will not cont rol the mcclk frequency se tting in the jedec file. in the case of device boot from internal flash the mcclk frequency is always 3.1 mhz. in the case of booting the device from external spi flash, the user can use ufw program inside the ispvm tool suite to convert the jedec file to bitstream for- mat. the ufw program supports mcclk_freq selections. in this case the user can select mcclk_freq dur- ing bitstream conversion. mcclk freq selections from ufw range 2.5 mhz to 130 mhz. security bit setting the security bit prevents readback of the sram and flash from jtag or the sysconfig pins. when the security bit is set the only operations available are erase and write. the security bit is updated as the last operation of sram configuration or flash programming. by using on- chip flash, and setting the security bit, the user can create a very secure device. the security bit is accessed via the desi gn planner in isplever design software. more information on device security can be found in the document fpga design security issues: using the ispxpga family of fpgas to achieve high design security . slave spi mode in the slave spi mode the cclk pin becomes an input and commands will be read into the latticexp2 on the sispi pin at the rising edge of cclk. data will be written out of the latt icexp2 on the sospi pi n at the falling edge of cclk. care must be exercised during read back of ebr or pfu memory. it is up to the user to ensure that reading these rams will not cause data corruption, i.e. these rams may not be read while being accessed by user code.
14-10 lattice semiconductor latticex p2 sysconfig usage guide the csspisn enables and disa bles the spi interface operation. when c sspisn is high the spi interface is dese- lected and the so spi pin is at high impedance. when csspisn is brought low the spi interface is selected, com- mands can be written into an d data read from the latticexp2. after po wer up the csspisn mu st transition from high to low before a new command can be accepted. the slave spi mode can also be used to access on-chip flash. the csspisn pin must be held low to write to on- chip flash; data is input from sispi. the slave spi mode can also be used for readback of both flash and sram. by driving the csspisn low, the device will input the read back instructions on the si spi pin and the data will be written out on the sospi pin; a bit in the read command will determine if the read is di rected to flash or sram. in order to support readback while the device is in user mode (the done pin is high), the slave_spi_port prefer- ence must be set to enable using the design planner. master spi mode in master spi mode the latticexp2 will drive cclk out to the slave spi flash device that will provide the bit- stream. the master device will write comm ands out on sispi at the rising e dge of cclk and will accept data on sospi at the falling edge of cclk. the master serial device starts driving cclk at the beginning of the configura- tion and continues to drive cclk until the external done pin is driven high and an additional 100 to 500 clock cycles have been generated. the cclk frequency on power up defaults to 2.5 mhz. the master clock frequency default remains unless a new clock frequency is loaded from the bitstream. self download mode self download mode (sdm) allows the fpga to configure itself without using any external devices, and because the bitstream is not exposed this is also a very secure configuration mode. the user may access on-chip flash using ispjtag or the slave spi port pins. jtag may access the on-chip flash any time the device is powered up, without disturbing device operation. jtag may also read and write the configuration sram. if access to the on-chip flash and sram is limited to jtag then slave_spi_port can be set to disabl e, freeing the dual-purpose pins for use as general purpose i/o. ispjtag mode the latticexp2 device can be configured through the ispj tag port. the ispjtag port is always on and available, regardless of the configuration mode selected. the slave_spi_port can be set to disable in the lattice isp- lever design software to tell the place and route tools that the jtag port will be used exclusively, i.e. the spi port will not be used. setting the slave_spi_po rt to disable allows software to us e all of the dual-purpose pins as general purpose i/os. isc 1532 configuration through the ispjtag port conforms to the ieee 15 32 standard. the boundary scan cells take con- trol of the i/os during any 1532 mode instruction. the boundary scan cells can be set to a pre-determined value whenever using the jtag 1532 mode. because of this the dedicated pins, such as done, cannot be relied upon for valid configuration status. transparent readback the ispjtag transparent readback mode allows the user to read the content of the device sram or flash while the device remains in a functional state. care must be exercised when reading ebr and distributed ram, as it is possible to cause conflicts with accesses from the user design (causing possible data corruption). the i/o and non-jtag configuration pins remain active during a transparent readback. the device enters the transparent readback mode through a jtag instruction. boundary scan and bsdl files bsdl files for this device can be found on the lattice website at www.latticesemi.com . the boundary scan ring covers all of the i/o pins, as well as the dedicated and dual-purpose sysconfig pins.
14-11 lattice semiconductor latticex p2 sysconfig usage guide wake up options when configuration is complete (the sram has been loaded), the device should wake up in a predictable fashion. the following selections determine how the device will wake up. two synchronous wake up processes are avail- able. one automatically wakes the device up when the intern al done bit is set regardless of whether the done pin is held low externally or not, the other waits for the done pin to be driven high before starting the wake up process. the done_ex preference determines whether the external done pi n will control the synchr onous wake up. when the device is in the sdm mode the done pin is not used and therefore the done_ex preference has no effect. wake up sequence table 14-6 provides a list of the wake up sequences supported by the latticexp2. table 14-6. wake up sequences supported by latticexp2 sequence phase t0 phase t1 phase t2 phase t3 1 done goe, gwdis, gsr 2 done goe, gwdis, gsr 3 done goe, gwdis, gsr 4 done goe gwdis, gsr 5 done goe gwdis, gsr 6 done goe gwdis gsr 7 done goe gsr gwdis 8 done goe, gwdis, gsr 9 done goe, gwdis, gsr 10 done gwdis, gsr goe 11 done goe gwdis, gsr 12 done goe, gwdis, gsr 13 goe, gwdis, gsr done 14 goe done gwdis, gsr 15 goe, gwdis done gsr 16 gwdis done goe, gsr 17 gwdis, gsr done goe 18 goe, gsr done gwdis 19 goe, gwdis, gsr done 20 goe, gwdis, gsr done 21 (default) goe gwdis, gsr done 22 goe, gwdis gsr done 23 gwdis goe, gsr done 24 gwdis, gsr goe done 25 goe, gsr gwdis done
14-12 lattice semiconductor latticex p2 sysconfig usage guide figure 14-3. wake up sequence to internal clock synchronous to internal done bit if the latticexp2 device is the only device in the chain, or the last device in a chain, the wake up process should be initiated by the completion of the configuration. once t he configuration is complete, the internal done bit will be set and then the wake up process will begin. synchronous to external done signal the done pin can be selected to dela y wake up. if done_ex is true th en the wake up sequence will be delayed until the done pin is high. the device will then follow th e wake_up sequence selected. when the device is in the sdm mode the done pin is not used and therefore the done_ex preference has no effect. software selectable options in order to control the configuration of the latticexp2 device beyond the default settings, software preferences are used. table 14-7 is a list of the preferences with their default settings. table 14-7. software preference list for the latticexp2 slave spi port in order to use the slave spi port while in user mode to read sram or flash memory, the slave_spi_port pref- erence must be set to enable. setting this preference preserves the slave spi port pins so the fpga can be accessed by an external device while in user mode. this also lets the software know that the slave spi port pins are reserved and not available for use by the fitter or the user. preference name default sett ing [list of all settings] slave_spi_port disable [disable, enable] master_spi_port disable [disable, enable] done_od on [off, on] done_ex off [off, on] config_secure off [off, on] wake_up 21 (done_ex = off) 4 (done_ex = on) wake_on_lock off [off, on] inbuf on [off, on] bclk done bit global output enable global set/reset global write disable done pin t0 t1 t2 t3
14-13 lattice semiconductor latticex p2 sysconfig usage guide master spi port in order to use the master spi port for configuration, the master_spi_port preference should be set to enable. configuration mode the device knows which physical sysconfig port will be us ed by reading the state of the cfg[1:0] pins, but the fitter software also needs to know which port will be us ed. the fitter will determine th e configuration mode based upon the setting of the slave_spi_port and the master_spi_port preferences. the user may set these preferences, and the ones listed below, using the design planner tool. there are several additional configuration options, such as overflow, that are set by software. these options are selected by clicking proper ties under generate bitstrea m data in isplever. if either overflow option is selected, then the done_ex and wake_up selections will be set to correspond (see table 14-8 ). refer to the configura- tion modes and options section of this document for more details. table 14-8. overflow option defaults done open drain the ?done_od? preference allows the user to configur e the done pin as an open drain pin. the ?done_od? preference is only used for the done pin. when the done pin is driven low, internally or externally, this indicates that configuration is not complete and the device is not ready for the wake up sequence. once configuration is com- plete, with no errors, and the device is ready for wake up, the done pin must be driven high. for other devices to be able to control the wake up process an open drain configuration is needed to avoid contention on the done pin. the ?done_od? preference for the done pin defaults to on. the done_od preference is automatically set to on if the done_ex preference is set to on. see table 14-9 for more information on the relationship between done_od and done_ex. when the device is in the sd m mode the done pin is not used and therefore the done_od and done_ex preferences have no effect. done external the latticexp2 device can wake up on its own after the done bit is set or wait for the done pin to be driven high externally. set done_ex = on to delay wake up until the done pin is driven high by an external signal synchro- nous to the clock; select off to synchronously wake up when the internal done bit is set and ignore any external driving of the done pin. the default is done_ex = off. if done_ex is set to on, done_od will be set to on. if an external signal is driving the done pin it should be open drain as well (an external pull-up resistor may need to be added). see table 14-9 for more information on the relationship between done_od and done_ex. table 14-9. summary of done pin preferences master clock selection when the user has determined that th e latticexp2 will be a master configurati on device (by properly setting the cfg[1:0] pins), and therefore provide the source clocking for configuration, the cclk pin becomes an output with the frequency set by the value in mcclk_freq. at the start of configuration the device operates at the default overflow option done_ex preference wake_up preference off off (default) default 21 (user selectable 1 through 25) off on default 21 (user selectable 1 through 25) on (either) on (automatically set by softwa re) default 4 (user selectable 1 through 7) done_ex 1 wake up process done_od 1 off external done ig nored user selected on external done low delays set to default (on) 1. when the device is in the sdm mode the done pin is not used and t herefore the done_od and done_ex preferences have no effect.
14-14 lattice semiconductor latticex p2 sysconfig usage guide master clock frequency of 2.5 mhz. some of the first bits in the configuration bitstream are mcclk_freq, once these are read the clock immediately starts operating at the user-defined frequency. the clock frequency is changed using a glitchless switch. the default mcclk frequency set in the bitstream is 3.1 mhz. security when config_secure is se t to on, no read back operation will be supported through the sysconfig or ispjtag port of the general contents. the ispjtag device id area is readable and not considered securable. default is off. wake up sequence the wake_up sequence controls three internal signals and the done pi n. the done pin will be driven after con- figuration and prior to user mode. see the wake up sequence section of this document for an example of the phase controls and information on th e wake up selections. the default se tting for the wake_up preference is determined by the done_ex setting. wake up with done_ex = off (default setting) the wake_up preference for done_ex = off (default) supports the us er selectable options 1 through 25, as shown in table 14-6. if the user d oes not select a wake-up sequence, t he default, for done_ex = off, will be wake-up sequence 21. wake up with done_ex = on the wake_up preference for done_ex = on supports the user selectable options 1 through 7, as shown in table 14-6. if the user does not select a wake-up sequence, th e default will be wake -up sequence 4. wake on lock selection the wake on lock preferen ce determines whether the device will wait for the pll to lock before beginning the wake-up process. on ? the device will not wake up until the pll lock signal for the given pll is active. off (default) ? the device will wa ke up regardless of the stat e of the pll lock signal. power save an i/o power save mode option, called inbuf, is used fo r the latticexp2 device and will deactivate unused input buffers to save power. this is only affects comparator type inputs pins (pins that use vref), like hstl, sstl, etc. the power save mode limits some of the functionality of boundary scan. for boundary scan testing it is recom- mended that the inbuf global preference be turned on to activate all unused input buffers. one time programmable fuse the latticexp2 has a one time programmable (otp) fuse that can be used to prevent the on chip flash configu- ration memory from being erased or programmed. this does not prevent the flash tag memory or flash user memory from being programmed, so th ese features are still available. the otp fuse can be set using the global configuration options in the ispl ever design planner or it can be set directly using the ispvm ? system software at the time of download. user goe the latticexp2 has a user goe (global output enable) feature. this allows the i/os to be held in boundary scan control after the standard wake-up sequence has completed. user logic determines when the outputs get turned over from boundary scan to user logic control. this us er logic input will be through a cib and is valid for jtag ?wake up? instructions only. this feature is instantiated by the user as a macr o called iowakeup. this macro only has one signal and can only be controlled immediately after the wakeup sequence (not anytime after).
14-15 lattice semiconductor latticex p2 sysconfig usage guide tag memory the tag memory is a block of flash memory which is always available for read or write (programming in flash terms) through the slave spi port. the latticexp2 can be in user mode or an un-programmed state (blank device), independent of the cfg[1:0] pin setting. the only exceptions would be when the latticexp2 is in bscan test or in direct programming mode. during these modes the spi interface is unavailable because the i/o is under bscan control. the tag memory is also available through the jtag port. table 14-10 shows the amount of tag memory available in each latticexp2 device. each latticexp2 device has one dedicated row of tag memory. table 14-10. latticexp2 family tag memory note: the initial power on value (initval) for all flash cells is all 1's. the tag memory has the following features and limitations. ? each row of tag memory is limited to sequential access only. once the read command is specified, the entire tag memory contents are read sequentially in a first-in-first-out manner. ? data access speed is limited by the speed of the tag memory which is flash based. ? the tag memory comes from the fact ory erased. it will retain the user as signed value after programming even during power off periods. ? the tag memory can be read or written using the hardwired jtag and spi interface pins. ? the tag memory is ready to use upon power-up of the latticexp2. it does not need any software ip or design loaded into the device to access the tag memory via the hardwired interface. ? the tag memory can also be read and modified from the fpga core logic using the slave-spi cib interface pins to emulate an i 2 c port. ? the tag memory is always accessible regard less of the security setting of the device. the tag memory is designed for storing typically ?static? dat a - data that is not likely to change. this tag memory can take the place of an eeprom or si mple flash memory on the pcb which might be used for the following sys- tem management and manufacturing control information (listed as examples only): ? saving electronic id codes ? version management ? date stamping ? manufacturing version control ? asset management and tracking ? system calibration settings ? device serialization and/or inventory control. device density tag memory (bits) tag memory (bytes) xp2-5 632 79 xp2-8 768 96 xp2-17 2184 273 xp2-30 2640 330 xp2-40 3384 423
14-16 lattice semiconductor latticex p2 sysconfig usage guide slave spi mode operation the slave spi mode interface to the tag memory supports both spi bus mode 0 and mode 3 operations. in spi bus mode 0 the clk pin is normally low when the spi master is in standby and data is not being transmitted. in spi bus mode 3 the clk pin is normally high during this condition. in both cases the data at the sispi pin is sam- pled on the rising edge of cclk and the data output on the sospi pin is clocked on the falling edge of cclk. for more information on using the tag memory please see tn1137, latticexp2 memory usage guide . user flash the user flash is designed as a non-volatile memory location to back up the data stored in the ebr ram blocks. this gives the user a reliable method to save the contents of the ram memory for later use. the amount of user flash for latticexp2 devices is directly tied to the number of ebr blocks in the device and it scales with density. the user flash is organized physically as either 1- or 2- separate user flash modules. how- ever, all user flash modules are logically treated as one unified block. table 14-11. user flash organization the ebr blocks act as the primary interface for the user fl ash. users do not have direct access to the user flash. the contents of the ebr can be saved into the user flash via a store-to-flash control signal. the ebr contents must be saved into the user flash when required. two signals, ufmfail and ufmbusyn are provided for keep- ing track of the status of the store-to-flash command. if the ufmfail signal is low and the ufmbusyn signal is high then the ebr contents were successfully stored in the flash memory. the user flash memory has the following constraints upon its usage. ? the store-to-flash operation has impact only on the ebr ram (single-port, true dual-port, pseudo dual-port) configurations. ? during the store-to-flash operation, the ebr blocks are unavailable for user operation and the flash is unavail- able for configuration operation. ? no selective ebr storing is supporte d. a store-to-flash operation will stor e the contents of all ebr blocks. ? due to silicon limitations the user cannot use store-to-f lash operation if the sed is operating in an always mode. ? ufm mode cannot co ncurrently be used with tran sparent/background mo de (flash or sram). the sspi config- uration and verify operations (which are essentially transparent mode operations) are initiated by the user and the user needs to ensure that the ufm operation is not requested at the same time. table 14-12. differences between user flash and shadow flash (ebr) behavior for more information, please see tn1137, latticexp2 memory usage guide . block type xp2-5k xp2-8k xp2-17k xp2-30k xp2-40k physical ufm blocks11222 logical ufm blocks11111 parameter user flash shadow flash (ebr) read/write access speed slow fast access nature sequential random data access limited (refer to sec13.3) infinite or unlimited data organization sequential, one bit at a time flexible, variable data width data granularity whole ufm block one ebr block
14-17 lattice semiconductor latticex p2 sysconfig usage guide technical support assistance hotline: 1-800-lattice (north america) +1-503-268-8001 (outside north america) e-mail: techsupport@latticesemi.com internet: www.latticesemi.com revision history date version change summary february 2007 01.0 initial release. may 2007 01.1 updated syscon fig pin descriptions added footnote to summary of done pin preferences table. january 2008 01.2 updated slave spi port information and programn pin usage. removed persistent and config_mode preferences. added slave_spi_port and master_spi_port preferences. february 2008 01.3 corrected slave_spi_port settings in ispjtag mode section. corrected initn pin description. corrected sdm configuration description in sram section. november 2008 01.4 updated dual-purpose sysconfig pins text section. april 2009 01.5 updated latticexp2 configuration modes table. june 2009 01.6 added clarification to mcclk frequency selection.
www.latticesemi.com 15-1 tn1142_01.1 may 2008 technical note tn1142 ? 2008 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. introduction unlike a volatile fpga, which requires an external boot-prom to store configuration data, the latticexp2? devices are non-volatile and have on-chip configuration flash. once programmed (either by jtag or spi port), this data is a part of the fpga device and can be used to self-download the sram portion without requiring any additional external boot prom. hence it is inherently more secure than volatile fpgas. like the latticeecp2/m, the latticexp2 family also offers the 128-bit advanced encryp tion standard (aes) to protec t the externally stored pro- gramming file. the user has total control over the 128-bit key and no special voltages are required to maintain the key within the fpga. additional security enhancement for the latticexp2 includes: ? a security bit for the configuration and user flash ? one-time-programmable (otp) or permanent lock capability ? flash protect this document explains the encryption and security features and how to take advantage of them. encryption/decryption flow the latticexp2 supports both encrypted and non-encrypted jedec files. since the non-encrypted flow is covered in tn1141, latticexp2 sysconfig? usage guide , this document will concentrate on the addition al steps needed for the encrypted flow. the encrypted flow adds only two steps to the normal fpga design flow, encryption of the configuration jedec file and programming the encryption key into the latticexp2. figure 15-1 is a block diagram describing the latticexp2 encryption data path s that will be used th roughout this document. figure 15-1. encryption block diagram along with flash protect encrypting the jedec file as with any other lattice fpga design flow, the design engineer must first create the design using the isplever ? design tool suite. the design is synthesized, mapped, placed and routed, and verified. once the user is satisfied with the design, the final jedec file is ready for fpga pr ogramming. this final jedec file is used to secure the design. the jedec file can be encrypted using isplever by going to the tools -> security settings pull-down menu or by using the universal file writer (isp ufw), which is part of the lattice ispvm ? system tool suite. crc sram data shift register decrypted data encrypted data flash protect key configuration flash program enable aes encrypt enable 128-bit flash decryption key 64-bit flash enable key configuration flash aes latticexp2 configuration encryption and security usage guide
15-2 latticexp2 configuration lattice semiconductor encrypti on and security usage guide isplever flow 1. as mentioned above, to access the latticexp2 security setting gui, go to project navigator -> tools -> security settings . a password is required before entering the security features gui section of the latticexp2. figure 15-2. password prompt with default password 2. this password gui prompt will automatically sh ow the default password ?latticesemi?. the default password is in place for users who do not want to remember any administrative password, and especially for those who want to use the config_secure setting only. users have the option of changing the pass- word. it is the user?s responsibility to track all the keys and passwords since they will not be stored in the design files. figure 15-3. security settings 3. once the user has selected security feat ures, encrypted files will then be generated. ispvm flow 1. start ispufw . you can start ispufw from the start -> programs -> lattice semiconductor menu in windows. you will see a window that looks similar to figure 15-4 . you can also launch the ispufw from the ispvm gui by clicking on the ufw button on the toolbar (shown in figure 15-5 ). select jedec as the out - put file format, as shown in figure 15-4 .
15-3 latticexp2 configuration lattice semiconductor encrypti on and security usage guide figure 15-4. universal file writer figure 15-5. ispvm main window 2. double-click on input data file and browse to the non-encrypted jedec file created using isplever. double-click on output data file and select an output file name. right-click on encryption and select on . right-click on encryption key and select edit encryption key . you will see a window that looks sim- ilar to figure 15-6. figure 15-6. encryption dialog window 3. enter the desired 128-bit encryption key. the key can be entered in hexadecimal or ascii. hex supports 0 through f and is not case sensitive. ascii supports all printable (ascii codes 30 through 126) characters. you may also import the 128-bit encryption key from the .bek generated by isplever. to do so, click on the load from file button shown in figure 15-6. click on ok to go back to the main ispufw window. note: be sure to remember this key, as lattice cannot recover lost keys. 4. from the ispufw menu bar click on project -> generate or the icon to create the encrypted jedec file. 5. before the latticexp2 can configure with the encrypted jedec file, the 128-bit encryption key used to encrypt the jedec file must be programmed into the latticexp2 device.
15-4 latticexp2 configuration lattice semiconductor encrypti on and security usage guide programming the key into the device the next step is to program the 128-bit encryption key into the latticexp2. note that this step is separated from jedec file encryption to allow flexibilit y in the manufacturing flow. this flow adds to design securi ty and it allows the user to control over-building of a design. over-building occurs when a third party builds more boards than are authorized and sells them to grey market customers. if the key is programmed at the factory, then the factory con- trols the number of working boards th at enter the market. the la tticexp2 will only configur e from a file that has been encrypted with the same 128-bit encryption key that is programmed into the latticexp2. to program the 128-bit encryption key into the latticexp2, proceed as follows. 1. start ispvm. you can start ispvm from the start -> programs -> lattice semiconductor menu in win - dows or from the isplever gui. you will see a window that looks similar to figure 15-5 . 2. attach a lattice ispdownload ? cable from a pc to the jtag connector wired to the latticexp2. note: the 128-bit encryption key can only be programmed into the latticexp2 using the jtag port. 3. apply power to the board. 4. if the window does not show the board?s jtag chain, then proceed as follows. otherwise, proceed to step number 5. a. click the scan button in the toolba r to find all lattice devices in the jtag chain. the chain shown in figure 15-5 has only one device, the latticexp2. figure 15-7. ispvm device information gui 5. double-click on the line in the chain cont aining the latticexp2 . this will open the device information win- dow (see figure 15-7). from the device access options drop-down box, select advanced security mode , then click on the security key button to the right. the window will look similar to figure 15-8.
15-5 latticexp2 configuration lattice semiconductor encrypti on and security usage guide figure 15-8. ispvm flash protection key 6. enter the 64-bit flash protect key or load it from the file (.key). you can save this to a file by clicking save to file button. once you click apply , you will be asked to ente r the 128-bit encryption as shown in figure 15-9. figure 15-9. ispvm encryption key gui 7. now enter the desired 128-bit encryption key. the key can be entered in hexadecimal or ascii. hex sup- ports 0 through f and is not case sensitive. ascii supports all printable (ascii codes 30 through 126) characters. this key must be the same as the key us ed to encrypt the jedec file. the latticexp2 will only configure from an encrypted jedec file whose 128-bit encryption key matches the one loaded into the latticexp2.
15-6 latticexp2 configuration lattice semiconductor encrypti on and security usage guide note: be sure to remember this key. once the key lock is programmed, lattice semiconductor cannot read back the128-bit encryption key. a. the 128-bit encryption key can be saved to a file using the save to file button. the 128-bit encryp- tion key will be encrypted using an 8-character file password that the user se lects. the name of the file will be .bek . in the future, instead of entering the 128-bit key, simply click on load from file and provide the file password. 8. programming the key lock secures the 128-bit encryption key. when satisfied, type yes to confirm, and then click apply . once the key lock is programmed and the device is power cycled, the 128-bit encryption key cannot be read out of the device. 9. from the main ispvm window ( figure 15-5 ) click on the green go button on the toolbar to program the 128-bit encryption key into the la tticexp2. when complete, the latt icexp2 will only co nfigure from a jedec file encrypted with a key that exactly matches the one just programmed. security bit for the configuratio n and user flash (config_secure) the config_secure setting is located in the gui setting (figure 15-3) mentioned in the previous section. after security for the device is selected, no readback operati on is supported through the sysconfig port or ispjtag? port of the general contents. this is considered the lowest level of security. advanced security settings selecting advanced security settings will enable more security features. on e-time programmable (otp), flash protect and encryption as shown in figure 15-3. these se ttings are mutually exclusive. selecting one or the other may nullify other fields that are not required for each particular security settings. one-time programmable (otp) or permanent lock one-time programmable (otp) or permanent lock is another feature that provides the highest level of security. this form of security is currently available only for latticexp2 devices. if otp fuses are programmed it permanently prevents write access to the devices contents. users must be aware before using this feature that once the otp is programmed it is not possible to erase or reprogram the device or its security settings. as the name implies, it is a one-time event only. table 15-1 specifies the behavior of the chip when security bit and the otp bit are pro- grammed. table 15-1. security and otp bit settings security config_secure otp bit action r e-program read back erase 0 0 do nothing yes yes yes 0 1 inhibit erase or programming no yes no 1 0 inhibit readback yes no yes 1 1 inhibit erase, programming or readback no no no
15-7 latticexp2 configuration lattice semiconductor encrypti on and security usage guide flash protect figure 15-10. flash protect the next highest level of security for the latticexp2 is the 64-bit flash protect feature. the 64-bit flash protect key is used to protect the embedded configuration flash from accidental or unauthorized erasure or reprogramming. this feature does not prevent the device from read back. therefore, user is given the option to turn on the config_secure feature. the default 64-bit flash protect key is ?_lattice?. users ca n also enter their own 64-bit flash protect key. if there is an existing 64-bit flash protect key in the flash protec t key file, the 64-bit flash protect key can be imported for the flash protect key file (.key). the ispvm gui will display th e flash protect key in the same for- mat selected when the 64-bit flash protect key was created. users have the option to change the 64-bit flash pro- tect key using the default by clicking on the default key button. the ispvm software will automatically check the latticexp2 devi ce to see if the flash prot ect feature is enabled. if it is, ispvm software will prompt the user to enter the 64-bit flash protect key before performing an erase or pro- gramming operation. if the 64-bit flash protect programmed in the device matches the 64-bit flash protect key entered in the ispvm gui, the device can be erased and reprogrammed. if the keys are lost, the programmed device will be an otp device. the re-programming of the device requires the user to ente r the 64-bit flash protect key programmed into the device first. if it matches the 64-bit ke y (stored in the device), the device will enter the pro- gramming mode for erasure and re-programming of the flash as well as the sram fuses. note: the flash protect key cannot be the same as the en cryption key. the flash protect key is 64 bits and the encryption key is 128 bits. changing flash protect if the user decides to change the key, it can be done in the key field. the newly created flash protect key file (.key) contains the new 64-bit flash protect key and is now ready to be programmed into a device. the user can also revert back to using the default password by clicking on the default button next to the flash pro- tect key. the default password is ?_lattice? . key input for programming tdi flash enable fuses flash program enable capture for fuse pattern verify. disabled when key lock fuse. update for fuse pattern programming tdo output for fuse pattern verification 64-bit key shift register
15-8 latticexp2 configuration lattice semiconductor encrypti on and security usage guide figure 15-11. encryption/flash protect advanced feature encryption the latticexp2 family of devices us es the 128-bit adva nced encryption st andard (aes) security mechanism and has a built-in aes decryption engine hard wired in the core and em bedded in the device. th e jedec file must be encrypted with the same 128-bit aes encryption key programmed into the device in order to configure it. the file is shifted into the device?s jtag port using ispvm system software. the device decrypts the jedec file using the 128-bit encryption key programmed into the device. the device can only be programmed if the 128-bit encryption key programmed into the device matches the 128-bit encryption key used to encrypt the jedec file. usercode in encrypted files note: the usercode is stored as a comment and will be programmed into the devi ce?s usercode. if the usercode is used as a custom de vice id (my_assp), the u field will still be used in the jedec file for the crc and the value of the custom device id set by the user will be part of the comment field. the usercode will be available for readback regardless of the encryption setting (the usercode is always available for readback). readback of the decrypted jedec file from a device through the jtag port is not permit- ted because the security fuse is programmed when encrypti on/flash protect is selected. encryption will not affect the functionality of the sed decryption flow the decryption flow is a much simpler process. start by programming the device with the 128-bit encryption key and the 64-bit flash protect key fuses. once the keys are programmed, the device can then be programmed with the encrypted jedec file.
15-9 latticexp2 configuration lattice semiconductor encrypti on and security usage guide figure 15-12. decryption flow verifying a configuration if the flash is programmed directly, the data is first decrypted and then the fpga performs a crc on the data. if all crcs pass, configuration was successful. if a crc does not pass, the done fu se is not programmed. references ? tn1141, latticexp2 sysconfig usage guide ? federal information processing stan dard publication 197, nov. 26, 2001. advanced en cryption standard (aes) technical support assistance hotline: 1-800-lattice (north america) +1-503-268-8001 (outside north america) e-mail: techsupport@latticesemi.com internet: www.latticesemi.com revision history date version change summary february 2007 01.0 initial release. may 2008 01.1 updated is plever security sett ings screen shot. program, key lock (security) fuse(s) notes: 1. supported on jtag port. 2. supported on both jtag port and slave spi interface. program, verify flash protect key fuses program, verify decryption key fuses enter 64-bit key code enter 64-bit key code enter 128-bit key code erase all configuration flash fuses start programming the keys 1 jedec file programming 2 verify usercode program done fuse program usercode program configuration flash encrypted jedec file erase the configuration flash, usercode read in 64-bit flash protect key program security fuse optional step, dependent on user selection. legend start done done
www.latticesemi.com 16-1 tn1130_02.0 september 2009 technical note tn1130 ? 2009 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. introduction soft errors occur when high-energy charged particles alter the stored charge in a memory cell in an electronic cir- cuit. the phenomenon first became an issue in dram, requi ring error detection and correction for large memory systems in high-reliability app lications. as device geometries have continue d to shrink, the probab ility of soft errors in sram has become significant for some systems. designe rs are using a variety of approaches to minimize the effects of soft errors on system behavior. sram-based fpgas store logic configuration data in sram cells. as the number and density of sram cells in an fpga increase, the probability that a soft error will alter the programmed lo gical behavior of the system increases. a number of approaches have been taken to address this issue, but most involve intellectual property (ip) cores that the user instantiates into the logic of their design, using valuable resources and possibly affecting design per- formance. the latticexp2 devices have a hardware implemented soft error detector which does not affect perfor- mance or heat dissipation of the devices. this document describes the hardware based soft error detect (sed) approach taken by lattice semiconductor for latticexp2? fpgas. sed overview the sed hardware in the latticexp2 devices consists of an access point to fpga configuration memory, a control- ler circuit, and a 32-bit register to store the crc for a given bitstream (see figure 16-1). the sed hardware reads serial data from the fpga?s configuration memory and calculates a crc. the data that is read, and the crc that is calculated, does not include ebr memory or pfus used as ram. the calculated crc is then compared with the expected crc that was stored in the 32-bit register. if the crc values match it indicates that there has been no configuration memory corruption, but if the values differ an error signal is generated. sed checking does not impact the performance or operation of the user logic. figure 16-1. system block diagram 1 latticexp2 user logic osc logic access sed control circuit config logic 32-bit crc register internal flash latticexp2 soft error detection (sed) usage guide
16-2 latticexp2 soft error lattice semiconductor de tection usage guide note that the calculated crc is based on the particular arrangement of configuration memory for a particular design. consequently, the expected crc results cannot be specified until after the design is placed and routed. the isplever ? bitstream generation software analyzes the conf iguration of a placed and routed design and updates the 32-bit sed crc register contents during bitstream generation. the following sections describe the latticexp2 sed implementation and flow, along with some sample code to get started with. basic sed and one- shot sed modes basic sed basic sed checks the crc for all bits. for basic sed (sedba), the inputs are sedclkin, sedenable, sed- start, and sedfrcerrn. the output signals are sedclkout, seddone, sedinprog, and sederr. once an error is de tected the sederr signal will stay high. sed supports the following so ft error corrections (sec): ?do nothing? or on-demand user reconfiguration by pulling the progamn pin low from another device. one-shot sed the one-shot sed setting is based on the one-shot fuse. the module (sedbb) has no input ports. the output signals are seddone, sedinprog, and sederr. at a mini mum, the user must connect sederr to an i/o pin in order to detect an error. hardware description as shown in figure 16-2, the latticexp2 sed hardware has several inputs and outputs that allow the user to con- trol, and monitor, sed behavior. figure 16-2. signal block diagram signal descriptions table 16-1. sed signal descriptions signal name direction active description sedclkin input n/a clock sedenable input high sed enable sedclkout output n/a output clock sedstart input high start sed cycle sedinprog output high sed cycle is in progress seddone output high sed cycle is complete sedfrcerrn input low force an sed error flag sederr output high sed error flag sed hardware block sedenable sedstart sedfrcerrn sedclkin sedclkout seddone sedinprog sederr (from internal oscillator)
16-3 latticexp2 soft error lattice semiconductor de tection usage guide sedclkin clock input to the sed hardware. when external spi configuration is used, this clock is de rived from the latticexp2?s on- chip oscillator. the on-chip oscillator?s output goes through a divi der to create mcclk. m cclk goes through another divider to create sed- clkin. the software default for mcclk is 2.5 mhz, but this ca n be modified using the mcclk_freq global preference in isplever?s pre-map design planner (see tn1141, latticexp2 sysconfig usage guide for supported values of mcclk). it has a range of 2.5 mhz to 66 mhz. the divider for sedclkin can be set to 1, 2, 4, 8, 16 or 32. the default is 1, so the default sedclkin frequency is 2.5 mhz. the divider value can be set using a parameter , see the example code at the end of this document. if internal flash configuration mode is used, sedclkin c an only be set to 3.1 mhz with a divider setting of 1. note that sedclkin is an inte rnally generated signal, so it should not be included as an input in the user design. see the examples at the end of this document. also note that while inputs to the sed block are clocked using sed- clkin, no attempt has been made to synchronize between clock domains. if this is a concern for a particular design then the designer will n eed to provide synchronization. osc_div options: 1, 2, 4, 8, 16 or 32 for external configuration. only 1 can be selected for internal configuration. the clk that drives the sed module will be set by mcclk/osc_div. sedenable level-sensitive signal which starts sed checking. table 16-2. sedenable sedclkout gated version of sedclkin, sedclkout is gated by sedenable. sedstart active high input to the sed hardware, sampled on the rising edge of sedclkin. table 16-3. sedstart sedfrcerrn active high input to the sed hardware, sampled on the rising edge of sedclkin. table 16-4. sedfrcerrn state description enables output of sedclkout, arms sed hardware. state description 1 start error detection. must be high a minimum of one sedclkin period. 0 no action. state description 1 no action. 0 forces sederr high, simulating an sed error.
16-4 latticexp2 soft error lattice semiconductor de tection usage guide sedinprog active high output from the sed hardware, clocked out on the rising edge of sedclkout. table 16-5. sedinprog seddone active high output from the sed hardware, clocked out on the rising edge of sedclkout. table 16-6. seddone sederr active high output from the sed hardware, clocked out on the rising edge of sedclkout. table 16-7. sederr sed flow figure 16-3. timing diagram state description 1 sed checking is in progress, goes high on the clock following sedstart high. 0 sed checking is not active. state description 1 sed checking is complete. reset by a high on sedstart or a low on sedenable. 0 sed checking is not complete. state description 1 sed has detected an error. reset by sedenable going low. 0 sed has not detected an error. 1 2 3 4 5 2 3 4 5 sed_enable sed_clk_out sed_start sed_inprog sed_done sed_err[_pad] 6
16-5 latticexp2 soft error lattice semiconductor de tection usage guide the general sed flow is as follows. 1. user logic sets sedenable high. this signal may be tied high if desired. 2. user logic sets sedstart high. sedinprog goes high. if seddone is already high it is driven low. sedstart may be tied high to enable continuous sed checking. 3. sed starts reading back data from the configuration sram. 4. sed finishes checking. sederr is updated, sedinprog goes low, and seddone goes high. 5. if sederr is driven high there are only two ways to reset it, drive sedenable low or reconfigure the fpga. 6. sedenable goes low when/if the user specifies, and sed is no longer in use. the user has two choices when an error is detected, ignore the error, and possibly log it, or reconfigure the fpga. reconfiguration can be accomplished by driving the progra mn pin low. this can be done by externally connect- ing a gpio pin to programn. figure 16-4. example schematic sed run time the amount of time needed to perform an sed check depends on the density of the device and the frequency of sedclkin. there will also be some overhead time for calculat ion, but it is fairly short in comparison. an approxi- mation of the time required can be found by using the following formula: maxbits / sedclkin = time maxbits is in mega-bits and depends on the density of the fpga (see table 16-8). sedclkin is frequency in mhz. time is in seconds for example, for a design using a latticexp2 with 5k look -up tables and the sedclkin is the software default of 3.1 mhz: 1.236 mbits / 3.1 mhz = 398.71 ms in this example, sed checking will take approximately 398.71 ms . remember that this h appens in the background and does not affect user logic performance. note that the internal oscillator used to generate sedclkin can vary by 30%. programn gpio open drain output latticexp2 vcc 10k
16-6 latticexp2 soft error lattice semiconductor de tection usage guide table 16-8. sed run time sample code the following simple example code shows how to instantiate the sed. in the example the sed is always on and always running, and the outputs of the sed hardware have been routed to fpga output pins. note that the sedba primitive is part of isplever 6.1 or later. basic sed vhdl example library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity example is port ( sed_done : out std_logic; sed_in_prog : out std_logic; sed_clk_out : out std_logic; sed_out : out std_logic); end; architecture behavioral of example is component sedba -- sed component generic (osc_div : integer := 1); -- set sedclkin divider port ( sedenable : in std_logic; sedstart : in std_logic; sedfrcerrn : in std_logic; sederr : out std_logic; seddone : out std_logic; sedinprog : out std_logic; sedclkout : out std_logic) ; end component; begin isnt1: sedba generic map (osc_div=> ?1?) port map ( sedenable => '1', -- tied high sedstart => '1', -- tied high sedfrcerrn => '1', -- tied high sederr => sed_out, -- wired to an output seddone => sed_done, -- wired to an output sedinprog => sed_in_prog, -- wired to an output sedclkout => sed_clk_out ) ; -- wired to an output end behavioral ; device xp2-5k xp2-8k xp2-17k xp2-30k xp2-40k density 1.236m 1.954m 3.636m 5.964m 8.304m 66mhz 18.7ms 29.6ms 55.1ms 90.4ms 126.2ms 50mhz 24.7ms 39.1ms 72.7ms 119.3ms 166.1ms 3.1mhz 399ms 624ms 1.173s 1.924s 2.679s 2.5mhz 495ms 782ms 1.455s 2.395s 3.325s
16-7 latticexp2 soft error lattice semiconductor de tection usage guide one shot sed in vhdl library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity example is port ( sed_done : out std_logic; sed_in_prog : out std_logic; sed_out : out std_logic); end; architecture behavioral of example is component sedbb -- this is for one shot sed generic (osc_div : integer := 1); -- set sedclkin divider port ( seddone : out std_logic; sedinprog : out std_logic; sederr : out std_logic ); end component; begin isnt1: sedbb generic map (osc_div=> ?1?) port map ( sederr => sed_out, -- wired to an output seddone => sed_done, -- wired to an output sedinprog => sed_in_prog); -- wired to an output end behavioral ;
16-8 latticexp2 soft error lattice semiconductor de tection usage guide basic sed verilog example module example ( sed_done, sed_in_prog, sed_clk_out, sed_out) ; output sed_done; output sed_in_prog; output sed_clk_out; output sed_out; assign v_hi = 1 ' b1; assign v_lo = 1 ' b0; sedba #(.osc_div(1)) sed_ip( .sedenable(v_hi), // always high .sedstart(v_hi), // always high .sedfrcerrn(v_hi), // always high .sederr(sed_out), // wired to an output .seddone(sed_done), // wired to an output .sedinprog(sed_in_prog), // wired to an output .sedclkout(sed_clk_out)); // wired to an output endmodule
16-9 latticexp2 soft error lattice semiconductor de tection usage guide one-shot sed in verilog module example ( sed_done, sed_in_prog, sed_clk_out, sed_out) ; output sed_done; output sed_in_prog; output sed_clk_out; output sed_out; assign v_hi = 1?b1; assign v_lo = 1?b0; sedbb #(.osc_div(1)) sed_ip( .seddone(sed_done), .sedinprog(sed_inprog), .sederr(sed_out) ); endmodule module sedbb (sederr, seddone, sedinprog); output sederr, seddone, sedinprog ; endmodule technical support assistance hotline: 1-800-lattice (north america) +1-503-268-8001 (outside north america) e-mail: techsupport@latticesemi.com internet: www.latticesemi.com
16-10 latticexp2 soft error lattice semiconductor de tection usage guide revision history date version change summary february 2007 01.0 initial release. january 2008 01.1 updated code in the following sections: basic sed vhdl example, one shot sed in vhdl, basic sed ve rilog example, one shot sed in verilog. january 2008 01.2 updated osc_div text section. updated sed flow text section. february 2008 01.3 updated timing diagram. march 2008 01.4 updated sedclkin and os c_div text sectio ns and sedenable table. april 2008 01.5 corrected ?sedfrcerr? to read ?sedfrcerrn?. july 2008 01.6 added footnote to sed flow timing diagram. august 2008 01.7 updated sedclkin and osc_div text sections. updated sed run time text section and sed run time table. january 2009 01.8 updated sed flow text section. added example schematic diagram. january 2009 01.9 updated basic sed verilog example code. updated one-shot sed in verilog code. september 2009 02.0 updated basic sed vhdl example code. updated one-shot sed in vhdl code.
www.latticesemi.com 17-1 tn1144_01.1 may 2007 technical note tn1144 ? 2007 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. introduction complementing its internal flash configuration memory, the latticexp2? also provides support for inexpensive spi flash devices. this provides the ability to use an alte rnate or backup bitstream, re ferred to as the ?golden? image. the device always attempts to load the primary image from the selected source. should any unexpected interrupts occur during conf iguration of the primary image , the latticexp2 device will au tomatically s witch sources and configure from the golden image location. dual boot mode the latticexp2 dual boot sysconfig? mode is selected using cfg pin settings. table 17-1 lists the syscon- fig modes supported by the latticexp2 device family. figure 17-1 illustrate s the spi flash hardware connections. table 17-1. latticexp2 sysconfig modes figure 17-1. latticexp2 hardware connections to spi flash internal logic is used to detect a c onfiguration failure from th e primary source and provid es the ability to reattempt configuration from the secondary source. this sequence is used when the latticexp2 is set to dual boot mode and configuration is initiated. configuration initiates in dual boot mode when any of the following events occur: ? the device is powered-up with all supplies reaching their required minimum values ? the programn pin is toggled ? the refresh command is is sued via the ispjtag? port should configuration from both prim ary and golden images in dua l boot mode fail, the initn pin will be driven low and the configuratio n process will halt. cfg1 cfg0 configuration mode primary boot source secondary boot source 0 0 dual boot external spi flash internal flash 1 0 internal flash external spi flash x 1 self download mode (sdm) internal flash none latticexp2 csspin cclk sispi sospi spi serial flash primary or golden image internal flash memory latticexp2 dual boot usage guide
17-2 lattice semiconductor latticexp2 dual boot usage guide dual boot flash programming in order to use dual configuration images, the data must be programmed for storage within the corresponding flash locations separately. ispvm ? system software provides the ability to pr ogram both latticexp2 internal flash and supported external spi flash memory devices. note: to allow programming of the external spi flash device, the latticexp2 cfg0 pin should be low. procedure note: this procedure assumes basic familiarity with ispv m system. for more informat ion on using ispvm system, refer to the tutorials and contents within the help system. 1. using isplever ? , create jedec files for the latticexp2 device to be used as primary and golden images. to preserve the sysconfig port, th e persistent option in the isplev er design planner must be set to on. 2. open ispvm system. 3. scan the chain or manually insert the devices representing the jtag chain. an example chain is shown in figure figure 17-2. ispvm system 4. double-click the latticexp2 device to open the device information window, as shown in figure 17-3, and select flash programming mode from device access options .
17-3 lattice semiconductor latticexp2 dual boot usage guide figure 17-3. device information window 5. under data file , browse to the appropriate jedec file to be programmed into the internal flash memory. 6. set the operation field to flash erase, program, verify . 7. press ok to return to the main ispvm system window. 8. press the green go button to download the data file into the latticexp2 internal flash memory. 9. to prepare a data file to program the spi flash, open the universal file writer tool by clicking the ufw button from the ispvm system toolbar. a window will appear, as shown in figure 17-4. figure 17-4. universal file writer
17-4 lattice semiconductor latticexp2 dual boot usage guide 10. specify a bitstrea m file output by pulling down the selector from the toolbar. 11. double-click input data file in the left-hand windowpane. browse to the appropriate isplever-created jedec file. 12. double-click output data file in the left-hand windowpane. select the desired path and name of the file to be created. the ufw window should appear similar to figure 17-5. figure 17-5. ufw settings for jedec to bitstream conversion 13. press the generate button or choose project->generate . the bitstream file will then be created. 14. close the ufw tool and return to ispvm system. 15. double-click the device in ispvm system to bring up the device settings dialog. 16. change the device access options to spi flash programming . this will bring up another dialog, as shown in figure 17-6.
17-5 lattice semiconductor latticexp2 dual boot usage guide figure 17-6. spi serial flash device selection 17. press select to choose from a list of supported spi flash devices. 18. under data file , browse to the appropriate bitstream file to be programmed into the external spi flash memory. the results should be similar to figure 17-7. figure 17-7. completed spi serial flash device settings 19. press ok to exit the spi serial flash device setup window. 20. at the main ispvm system window, the latticexp2 de vice is now ready to program the spi flash device. click the green go button on the toolbar to execute this process. provided the latticexp2 cfg pins are set to one of the dual boot modes, the device is now configured to use the corresponding dual boot capab ility. upon toggling the progr amn pin or power cycling, the device will load the primary image.
17-6 lattice semiconductor latticexp2 dual boot usage guide technical support assistance hotline: 1-800-lattice (north america) +1-503-268-8001 (outside north america) e-mail: techsupport@latticesemi.com internet: www.latticesemi.com revision history date version change summary february 2007 01.0 initial release. may 2007 01.1 added note to dual boot flash programming section. updated step 1 in the procedure section.
www.latticesemi.com 18-1 tn1143_01.0 june 2007 technical note tn1143 ? 2007 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. introduction starting a complex system with a large fpga hardware design requires that the fpga designer pay attention to the critical hardware implementation to increase the chances of success for the hardware. this technical note sys- tematically steps through these critical hardware implementation items relative to the latticexp2? device. latticexp2 is the third-generation non-volatile fpga from lattice with on-chip flash to store the configuration. the device family consists of fpga lut densities ranging from 5k to 40k. this technical note assumes that the reader is familiar with the latt icexp2 device features as described in the latticexp2 family data sheet . the critical hardware areas covered in this technical note are: ? power supplies as they related to the latticexp2 supply rails and how to connect them to the pcb and the asso- ciated system ? configuration and how to connect the configuration mode selection for proper power up configuration ? device i/o interface and critical signals power supply the v cc and v ccaux power supplies determine the latticexp2 internal ?power good? condition. in addition to the two power supplies, there are v ccio0-7 , v ccpll and v ccj supplies that power the i/o banks, pll and jtag port. all power supplies are required for the proper device operation but since v cc and v ccaux determine the device power-on condition, it is recommended to have one of these supplies be the final power supply to power up the latticexp2 device after all other power supplies are stable. table 18-1 shows the power supplies and the appropri- ate voltage levels for each supply. table 18-1. power supply description and voltage levels power supply sequencing there is no specific power sequencing requirement for the latticexp2 device family. if the user's system has the option to design for power sequencing, a practical sequencing to keep in mind is based on the fact that v cc and v ccaux determine when the core powers up. in order insure proper functional behavior, it is desirable to bring up the v ccio , v ccj and v ccpll first in any order and bring up v cc first and v ccaux next in a sequential order. power sequencing considerations should also consider that commo n supplies generally are tied together to the same rail. for example, if there is a 3.3v v ccio , it should be tied to the same supply as the 3.3v rail for v ccaux . latticexp2 is able to tolerate any order of power sequencing without causing any high current leakage paths during power up. supply voltage (typ.) description v cc 1.2v core power supply. a typical v cc device internal power up and power down trip point is between 0.7v and 0.9v. v ccaux 3.3v auxiliary power supply. a 3.3v supply that provides an internal reference to the input buffers. a typical v ccaux device internal power up and power down trip point is between 2.0v and 2.8v. v ccpll 3.3v power supply for pll. v ccio0-7 1.2v to 3.3v i/o power supply. there are eight banks of i/os and each bank has its own supply v ccio0 to v ccio7 . v ccj 1.2v to 3.3v jtag power supply for tap controller port. latticexp2 hardware checklist
18-2 lattice semiconductor latticex p2 hardware checklist power supply ramp similar to the power supply sequencing, there is no specific requirement for the latticexp2 but care must be given to the power supply ramp times in a reasonable range. the reasonable range is defined by the majority of the power supply related device test data taken as part of the device characterization. the fast end of the spectrum is defined to be 100s for the supply to transition from zero volts to minimum supply voltage level. the slow end of the spectrum is defined to be 100ms for the supply to transition from zero volts to minimum supply voltage. these ranges should be used as general guidelines for the system design consideration. power estimation once the latticexp2 device density, package and logic implemen tation is decided, power estimation for the system environment should be determined based on the software power calcul ator provided as part of isplever ? design tool. the power estimation should keep two specific goals in mind. 1. power supply budgeting should be considered based on the maximum of the power-up in-rush current, configuration current or maximum dc and ac current for given system environmental condition. 2. the ability for the system environment and latticexp2 device packaging to be able to support the specified maximum operating junction temperature. by determining these two criteria, system design planning can take the latticexp2 power requirements into con- sideration early in the design phase. configuration there are two options to configure the latticexp2 devices. the obvious and most common method is using the on- chip flash memory. this method is called the self download mode or sdm. the sdm is determined by the cfg0 signal. cfg0 needs to be pulled high in order to boot th e device from the on-chip flash memory. external pull-up resistor highly recommended pulling up the cfg0 signal to the 3.3v supply rail. table 18-2 shows the proper cfg bit setting. table 18-2. configuration mode selection the spi configuration port resides in i/o bank 7. accordingly, the v ccio7 must match the supply rail of the spi flash. for example, if the external spi flash uses 3.3v rail, v ccio7 must be tied to 3.3v supply rail as well. there are several dual-purpose pins that can be used as general-purpose i/o pins when not used for configuration. table 18-3 lists these dual-purpose pins. when cfgx is se t to one of the two external spi flash options and persis- tence is off, the dual-purpo se configuration pins will become general-pur pose i/o pins after configuration. these pins should be used only when they are not used for co nfiguration. when used for configuration, persistence should be on, to dedicate these pins for configuration. in or der to insure proper configuration, it is recommended to use external resistors for the configuration pins. the cfg0 must have external resistor for any configuration mode. when cfg0=0, cfg1, programn, initn and done pins must have the appropriate external pull-up or pull- down resistors. configuration mode cfg1 cfg0 description spi flash boot 0 0 master spi boot first then embedded flash. embedded flash boot 1 0 embedded flash b oot first then external spi flash. self download mode (sdm) x 1 sdm only.
18-3 lattice semiconductor latticex p2 hardware checklist table 18-3. configuration pin descriptions jtag interface the jtag interface pins are referenced to v ccj . typically, jtag pins are referenced to 3.3v supply. v ccj can sup- port supplies from 1.2v to 3.3v. in cases where v ccj is connected to supplies other than 3.3v, validate that the jtag interface cable or tester can support i/o interface with the same i/o voltage standard. i/o interface and critical pins there are eight i/o banks on every latticexp2 device. i/o ba nk 7 contains the configurat ion pins and as such, the configuration requirements should have the highest priority to determine the supply voltage levels for v ccio7 . i/o pin assignments around v ccpll the v ccpll provides a ?quiet? supply for the internal plls. for the best pll jitter performance, careful pin assign- ment must keep away the ?noisy? i/o pins away from the bga ball location that are identified as sensitive pins as shown in figure 18-1. in this case the sensitive pins would be one of the v ccpll supply pins. the ?noisy? i/o pins are generally defined to have the highest switching frequency, highest v ccio standard and fastest output slew rates. for example, using the figure 18-1 3x3 and 5x5 grid of ball locations, one can identify the ?keep out? ball locations for the potentially ?noisy? signals. figure 18-1. ?quiet? pin assignmen t consideration for bga package pin name i/o type pin type description cfg0 input, weak pull-up dedicated fpga configuration mode selection cfg1 input, weak pull-up dual-purpose programn input, weak pull-up dual-purpose fpga configuration ? control and status signals initn bi-directional open drain, weak pull-up dual-purpose done bi-directional open drain with weak pull-up or active drive dual-purpose cclk input or output dual -purpose configuration clock sispi input or output dual-purpose spi control and data ? signals sospi input or output dual-purpose csspisn input, weak pull-up dual-purpose csspin output, tri-state, weak pull-up dual-purpose 5x5 5x5 5x5 5x5 5x5 5x5 3x3 3x3 3x3 5x5 5x5 3x3 sensitive pin 3x3 5x5 5x5 3x3 3x3 3x3 5x5 5x5 5x5 5x5 5x5 5x5
18-4 lattice semiconductor latticex p2 hardware checklist ddr/ddr2 memory inte rface pin assignments the ddr memory interface on the lattic exp2 device family is provided wit h a pre-engineered i/o register along with the precision i/o dll timing control. there are two i/o dll specifically assigned to the two halves of the device. one i/o dll supports i/o banks 1, 2, 3 and 4; another i/o dll supports i/o banks 0, 5, 6 and 7. in addition to the i/o dll assignments, there are pre-de fined data strobes (dqs) signals that can support a span of i/o pins as part of the memory data lanes. when assigning ddr memory interface i/o pins, the fpga designer must insure that there is enough i/o pins to assign ddr memory data pins for each of the assigned dqs signals. true-lvds output pin assignments true-lvds outputs are available on 50% of the i/o pins on the left and right sides of the device. the left and right side i/o banks are banks 2, 3, 6 and 7. when using the lvds outputs, a 2.5v supply needs to be connected to these vccio supply rails. hstl and sstl pi n assignments these externally referenced i/o standards require an external reference voltage. each of the latticexp2 device family i/o banks allows up to two pre-defined v ref pins. the v ref pin(s) should get the highest priority for pin assignment. pci clamp pin assignment pci clamps are available on the top and bottom sides of the device. when the system design calls for pci clamp, those pins should be assigned to i/o banks 0, 1, 4 and 5. for the clamp characteristic, refer to the ibis buffer mod- els either on the lattice website at www.latticesemi.com or in the isplever design tool. test output enable (toe) toe signal is used to tri-state all i/o pins and override the functional outputs for board level test. it is recommended to have a pull-up resistor to make su re that when not in use, the toe will not interfere with the no rmal functionality of the i/o pins.
18-5 lattice semiconductor latticex p2 hardware checklist checklist technical support assistance hotline: 1-800-lattice (north america) +1-503-268-8001 (outside north america) e-mail: techsupport@latticesemi.com internet: www.latticesemi.com revision history latticexp2 hardware checklist item ok n/a 1 power supply 1.1 core supply vcc @1.2v 1.2 auxiliary supply v ccaux @ 3.3v 1.3 pll supply v ccpll @ 3.3v 1.4 jtag supply v ccj from 1.2v to 3.3v 1.5 i/o supply v ccio0-7 from 1.2v to 3.3v 1.6 supply sequencing considerations 1.7 supply ramp considerations 1.8 power estimation 2 configuration 2.1 consistency of v ccio7 supply if external spi flash is used 2.2 configuration control and status selections 2.2.1 pull-up or pull-down on cfg0 2.2.2 pull-up or pull-down on cfg1 1 2.2.3 pull-up on programn 1 , initn 1 , done 1 , toe 2.2.4 pull-down on tck 2.3 jtag supply and default logic levels 3 i/o pin assignment 3.1 i/o pin assignments around v ccpll 3.2 ddr memory pin assignment considerations 3.3 true-lvds pin assignment considerations 3.4 hstl and sstl pin assignment considerations 3.5 pci clamp requirement considerations 1. only necessary when cfg=0. date version change summary june 2007 01.0 initial release.
section iii. latticexp2 fa mily handbook revi sion history
february 2010 handbook hb1004 ? 2010 lattice semiconductor corp. all lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www .latticesemi.com/legal. all other brand or product names are trademarks or registered trademarks of their respective holders. the specifications and information herein are subject to change without notice. www.latticesemi.com 19-1 revision history date handbook revison number change summary may 2007 01.1 initial release. july 2007 01.2 technical note tn1137 updated to version 01.1. september 2007 01.3 latticexp2 family data sheet updated to version 01.2. january 2008 01.4 technical note tn1130 updated to version 01.1. technical note tn1137 updated to version 01.3. technical note tn1141 updated to version 01.2. february 2008 01.5 latticexp2 family data sheet updated to version 01.3. technical note tn1130 updated to version 01.3. technical note tn1141 updated to version 01.3. technical note tn1137 updated to version 01.4. april 2008 01.6 latticexp2 family data sheet updated to version 01.4. technical note tn1130 updated to version 01.4. technical note tn1137 updated to version 01.5. april 2008 01.7 technical note tn1136 updated to version 01.1. june 2008 01.8 latticexp2 family data sheet updated to version 01.5. technical note tn1137 updated to version 01.6. technical note tn1142 updated to version 01.1. june 2008 01.9 technical note tn1137 updated to version 01.7. july 2008 02.0 technical note tn1130 updated to version 01.6. september 2008 02.1 latticexp2 family data sheet updated to version 01.6. technical note tn1130 updated to version 01.7. november 2008 02.2 technical note tn1141 updated to version 01.4. added tn1143, latticeecp2/m hardware checklist. january 2009 02.3 technical note tn1130 updated to version 01.8. may 2009 02.4 technical note tn1130 updated to version 01.9. technical note tn1136 updated to version 01.2. technical note tn1137 updated to version 01.8. technical note tn1138 updated to version 01.2. technical note tn1141 updated to version 01.4. february 2010 02.5 technical note tn1126 updated to version 01.1. technical note tn1130 updated to version 02.0. technical note tn1136 updated to version 01.2. technical note tn1138 updated to version 01.3. technical note tn1141 updated to version 01.6. note: for detailed revision changes, please refe r to the revision history for each document. latticexp2 family handbook revision history


▲Up To Search▲   

 
Price & Availability of LFXP2-8E-5FT256I

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X